PRACTICE PROBLEM SET 2 Graph Theory Basics and Behavioral

advertisement
PRACTICE PROBLEM SET 2
Graph Theory Basics and Behavioral Synthesis
1. Which of the following are true given the provided graph?
(a) The graph is an acyclic graph.
(b) The graph is a directed graph.
(c) Given a source vertex s, the distance to vertex i using a breadth first search is 4
(d) Only one topological ordering of vertices is possible.
(e) None of the above.
2.
Which of the following are true given graph G (Fig. 2)?
(a)
The graph is cyclic graph.
(b)
Dijkstra’s Algorithm can be used to find the shortest path from vertex a to vertex h.
(c)
Bellman Ford’s Algorithm can be used to find the shortest path from vertex a to vertex h.
(d)
Using the BFS algorithm and the edge weights provided, the distance from vertex b to vertex g
is 2.
(e)
None of the above
Fig. 1: Graph used in Problem 1.
s
c
d
e
g
h
k
i
Fig. 2: Graph used in Problem 2.
1
a
0
d
4.
All-pairs shortest path.
(b)
Single-source shortest path.
(c)
Single-destination shortest path.
(d)
Single-pair shortest path.
(e)
None of the above.
Which of the following provides a valid topological sort of the graph provided to the right?
(a)
a, b, c, e, d
(b)
a, b, c, d, e
(c)
c, a, d, e, b
(d)
a, e, b, c, d
(e)
None of the above
6.
Identify which of the following algorithms is an unconstrained scheduling algorithm.
(a)
ASAP
(b)
ALAP
(c)
Hu
(d)
LIST_L
(e)
None of the above
Minimizing latency is the goal of which of the following scheduling algorithms?
(a)
ALAP
(b)
HU
(c)
LIST_L
(d)
LIST_R
(e)
None of the above
3
h
Fig. 3: Graph used in Problem 4.
a
b
c
d
e
5.
f
2
4
What type of shortest path problem does DAG-SHORTEST-PATHS solve?
4
4
e
-3
g
(a)
c
2
5
9
4
3.
-1
b
7.
Which of the following is a latency-constrained scheduling algorithm?
(a)
ASAP
(b)
Simulated Annealing
(c)
LIST_L
(d)
Graph Coloring
(e)
ALAP
Fig. 4: Graph used in Problem 8.
nop
Time 1
8.
What is the mobility of node 7 in Fig. 4?
(a)
0
(b)
1
(c)
2
(d)
3
(e)
4
2
+
3
Time 2
Time 3
5
Time 4
6
<
4
*
*
*
*
7
+
nop
9. Assuming the compatibility graph provided in Fig. 5, which of the following are valid
cliques
(a)
{1}
(b)
{1, 3, 8}
(c)
{3, 8, 7, 2}
(d)
{1, 2, 3, 6, 7, 8}
(e)
None of the above
Fig. 5: Compatibility graph for Problem 9.
10. Compute the distance for all nodes in the given graph,
(a) Using breadth first search with a start vertex of c.
(b) Using depth first search. (If multiple choices exist, assume a processing order of g, h, i, k, c, d, e, s)
s
c
d
e
g
k
1
h
i
11. Provide at least three valid (and different) topological sorts of the provided graph.
d
9
e
f
4
2
8
g
h
2
1
j
1
1
k
2
1
z
12. Using Dijkstra’s shortest path algorithm, determine the resulting distances and predecessor relations with a source vertex of b. Be sure
to show each iteration of the algorithm.
3
a
2
e
6
b
4
1
c
3
d
5
2
13. Determine the mobility of each node in the sequencing graph below.
nop
1
2 >>
+
4
7
*
+
nop
3
5
+
6
+
8
/
*
14. Utilizing Hu’s algorithm, schedule the sequencing graph below given a = 2. Assume all operations require 1 cycle.
nop
1
*
5
*
8
*
2
+
3
<
6
+
9
4
*
7
+
-
nop
15. Utilizing the LIST_L algorithm, schedule the sequencing graph below given 2 multipliers and 1 ALU is available. Assume multiply operations require 2
cycles and ALU operations require 1 cycle.
nop
1
*
4
*
2
3
+
nop
5
*
6
-
7
/
+
nop
16. Given the sequencing graph in Fig. 3, utilize the LIST_R algorithm to determine the
minimum number of multipliers and ALUs needed assuming
(a) latency constraint = 4
(b) latency constraint = 5
1 +
2 *
3 *
4 <
5 *
9
-
10
/
6 *
7 *
8 *
nop
17. Given the following conflict graph, how many ALUs and multipliers are needed?
nop
Time 1
1
2
/
3
Time 2
Time 3
5
Time 4
6
<
4
/
*
*
*
7
*
nop
18. Given the provided scheduled sequencing graph, determine the minimum number of
multipliers and registers that are needed along with the resulting bindings by using the
following options,
(a)
(b)
(c)
Provide the corresponding compatibility graph and trace through the execution of
the CLIQUE_PARTITION algorithm.
Provide the corresponding conflict graph and trace through the execution of the
VERTEX_COLOR algorithm
Provide the corresponding interval graphs (i.e. the graphical representation for
the intervals as well as L) and trace through the execution of the LEFT_EDGE
algorithm.
nop
Time 1
Time 2
Time 3
Time 4
1
z1
5
6
4
2
+
/
3
z5
*
z2
*
*
z3
*
z4
7
nop
+
Download