2.2 Planning the Attack with Graph Theory!

You must submit this in an archive named "vertsep.zip".

Flavor text: Moroni must plan his attack on Amalickiah’s supply chains. But first he must determine what the bi-connected components, bridges, and separating vertices are to correctly target those important points.

You must implement an algorithm to compute the bi-connected components, bridges, and separating vertices of a graph.

Your program should accept a description of an undirected graph in the following format:

 

graph

 ::= 

integer edge*

 

edge

 ::= 

node >- weight -> node

 

node

 ::= 

integer

 

weight

 ::= 

integer

where the first integer is the largest node and the RHS of an edge is greater than the LHS. (White space is allowed between any terms.) (You will not actually use the weights, but they are included for reusability of graph test files.)

You may want to write a program to generate such inputs.

Your program should output in the following format:

Separating Vertices:

<node> ...

 

Bi-connected Components:

(<node> ...)

...

 

Bridges:

(<node> -> <node>) ...

You must test your program on graphs of at least 1000 nodes.

Your program must output the time it took to solve the problem (not read in the input and solve the problem.)

If you want to, follow these directions instead.