cycleDetection

Detect cycles in graphs
Log | Files | Refs | README

main.c (342B)


      1 #include "cycleDetection.h"
      2 
      3 #include <stdio.h>
      4 #include <stdlib.h>
      5 
      6 int main(int argc, char **argv) {
      7 	if(argc < 2) {
      8 		printf("Missing argument: input file\n");
      9 		printf("Usage:\n");
     10 		printf("%s <filename>\n", argv[0]);
     11 		return 1;
     12 	}
     13 	
     14 	Graph *g = Graph_read(argv[1]);
     15 	if(!g) return 2;
     16 	cycleDetection(g);
     17 	Graph_delete(g);
     18 	return 0;
     19 }