Parallel Processing of Irregular Computations: VHDL and Depth-First Search, Slides of Parallel Computing and Programming

An overview of parallel processing of irregular computations through discrete event simulation using vhdl. It includes the vhdl code for a simple circuit, descriptions of discrete event simulation basics, and depth-first search algorithms for finding solutions in graphs. The document also covers various search techniques and their applications.

Typology: Slides

2012/2013

Uploaded on 04/30/2013

devank
devank 🇮🇳

4.3

(12)

152 documents

1 / 61

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 10: Parallel
Processing of Irregular
Computations
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d

Partial preview of the text

Download Parallel Processing of Irregular Computations: VHDL and Depth-First Search and more Slides Parallel Computing and Programming in PDF only on Docsity!

Lecture 10: Parallel

Processing of Irregular

Computations

Discrete Even Simulation—Basics

Discrete Even Simulation—Basics (cont’d)

Parallel DES for Logic Simulation

Search Techniques

A

B C

D

E

F

G

A

B C

D

E

F

G

1

2

3

4

5 6

7

DFS (black arcs) and Soln_DFS (black+red arcs)

Graph BFS

dfs(v) /* for basic graph visit or for soln finding when nodes are partial or full solns */ v.mark = 1; for each (v,u) in E if (u.mark != 1) then dfs(u)

Algorithm Depth_First_Search_Soln for each v in V v.mark = 0; for each v in V if v.mark = 0 then if G has partial soln nodes then dfs(v); else soln_dfs(v);

soln_dfs(v) /* used when nodes are basic elts of the problem and not partial soln nodes, and a soln. is a path / v.mark = 1; If path to v is a soln, then return(1); for each (v,u) in E if (u.mark != 1) then soln_found = soln_dfs(u) if (soln_found = 1) then return(soln_found) end for; v.mark = 0; / can visit v again to form another soln on a different path */ return(0)

A

B C

D

E

F

G

1

2

3

4 5

6

7

8

9

Soln found (A,B,E,C,F)

10

Best-First Search

BeFS (root) begin open = {root} /* open is list of gen. but not expanded nodes—partial solns / best_soln_cost = infinity; while open != nullset do begin curr = first(open); if curr is a soln then return(curr) / curr is an optimal soln / else children = Expand_&_est_cost(curr); / generate all children of curr & estimate their costs---cost(u) should be a lower bound of cost of the best soln reachable from u / for each child in children do begin if child is a soln then delete all nodes w in open s.t. cost(w) >= cost(child); endif store child in open in increasing order of cost; endfor endwhile end / BFS */

Expand_&est_cost(Y) begin children = nullset; for each basic elt x of problem “reachable” from Y & can be part of current partial soln. Y do begin if x not in Y and if feasible child = Y U {x}; path_cost(child) = path_cost(Y) + cost(Y, x) /* cost(Y, x) is cost of reaching x from Y / est(child) = lower bound cost of best soln reachable from child; cost(child) = path_cost(child) + est(child); children = children U {child}; endfor end / Expand&_est_cost(Y);

Y = partial soln. = a path from root to current “node” (a basic elt. of the problem, e.g., a city in TSP, a vertex in V0 or V1 in min-cut partitioning). We go from each such “node” u to the next one u that is “reachable “ from u in the problem “graph” (which is part of what you have to formulate)

u 10

(^12 ) 19

18 17

18

16

(1)

(2)

(3)

costs

root

Best-First Search

Proof of optimality when cost

is a LB

  • The current set of nodes in

“open” represents a complete

front of generated nodes, i.e.,

the rest of the nodes in the

search space are descendants

of “open”

  • Assuming the basic cost (cost

of adding an elt in a partial soln

to contruct another partial soln

that is closer to the soln) is

non-negative, the cost is

monotonic , i.e., cost of child >=

cost of parent

  • If first node curr in “open” is

a soln, then cost(curr) <=

cost(w) for each w in “open”

  • Cost of any node in the search

space not in “open” and not

yet generated is >= cost of its

ancestor in “open” and thus >=

cost(curr). Thus curr is the

optimal (min-cost) soln

u 10

(^12 ) 19

18

17

18

16

(1)

(2)

(3)

costs

root

Y = partial soln.