Read the Preamble for information on the assignments and how to handle the input files.
You should submit your file using the command
submit-mth607 bipartite.c
on jupiter.
The input will be a (di)graph. (See the preamble for information on how the graph should be input and its format.)
Your graph should return 0 if the input graph is not bipartite, 1 if it is and -1 on an error.
In addition to the return value, your program should print, using
printf, a list of the vertices in each part in ascending order. The
vertices should be separated by spaces, the two parts by a newline
(\n).
For example for the 6 cycle (0, 1, 2, 3, 4, 5) the output would look like:
0 2 4
1 3 5
The order of the vertices should be the same as in the adjacency matrix obtained from the input file, starting from 0.
Your program should be able to deal with digraphs and non-simple graphs.