CS 350
cpts350 hw6 1. Let G be a DAG (a graph without loops) and 25,1) be two designated nodes (there are many other nodes in G). Design an efcient...
View the step-by-step solution to:

Question

question 5 please!!'

Screen Shot 2019-11-01 at 12.32.31 PM.png

Screen Shot 2019-11-01 at 12.32.31 PM.png

cpts350 hw6 1. Let G be a DAG (a graph without loops) and 25,1) be two designated nodes
(there are many other nodes in G). Design an efficient algorithm to count
the number of paths from u to v. 2. Let G be a DAG (a graph without loops) and 15,1) be two designated nodes
(there are many other nodes in G). In particular, each node in G is labeled
with a color and multiple nodes can share the same color. A good path is
one where the number of green nodes is bigger than the number of yellow
nodes. Design an efficient algorithm to count the number of good paths from
a: to v. 3. Let G be a graph (so it may have loops) and u, v be two designated nodes
(there are many other nodes in G). In particular, each node in G is labeled
with a color and multiple nodes can share the same color. Suppose that ”y
is a regular expression on colors (e.g., (green + yellowyellow)*yellowblue).
An ugly path is one that the color sequence on the path satisfies the regular
expression 7. Design an efficient algorithm to count the number of ugly paths
from u to ’0 (when the count is innfinite, return 00). 4. Let G be a graph that may contain loops and hence, the number of paths
from a designated start node to a designated end node may be infinite. Un-
fortunately, you usually can’t say that one infinite number is larger than
another. Here is the problem: sketch a way to compare the number of paths
in two graphs (that both may contain loops). (Hint: google perron, graph,
path count). 5. Let G be a control flow diagram of a C-progrm (which can be automatically
generated). For each node a in the diagram, one can obtain the total number
0(a) of paths from the root of the diagram to u. Then, from what you got
from 4 above, you may sort all the C(u)’s for all u (even though some of
C(u)’s are infinite) and then pick a ma“ that has the maximal C(u). Write a
mini-paper on how this will address the problem of testing a C-program. (if
you want, you can actully publish a paper on this get a Master degree!)

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes