Ryerson Crest Ryerson Header

MTH 607 Graph Theory Assignment 3


General

In this assignment you will implement the Block finding algorithm on a weighted graph G. The block finding algorithm can be found in the Connectivity Handout. Your program will be tested against digraphs as well, the algorithm given should work without modification.

Input

The input will be a (di)graph. (See the preamble for information on how the graph should be input and its format.)

Name

Note your submitted file should be named block.c

Output

Your program should write a file for each block of the graph, containing that component in our standard format (see the preamble). You should use write_graph to write your output files.

These output files should have the file names block.i, where i is an index, from 0 up to the number of blocks - 1. So for example, if there where 4 blocks you would create the files:
block.0
block.1
block.2
block.3

Return Value

Your program should return the number of blocks found.

Notes


Maintained by: P. Danziger, March 2008