#include <stdio.h>
// #include "graph.h"
#include "graph.h"

// #ifdef _MSC_VER
// #pragma warning(disable: 4661)
// #endif
// 
// // Instantiations: <captype, tcaptype, flowtype>
// // IMPORTANT: 
// //    flowtype should be 'larger' than tcaptype 
// //    tcaptype should be 'larger' than captype
// 
// template class Graph<int,int,int>;
// template class Graph<short,int,int>;
// template class Graph<float,float,float>;
// template class Graph<double,double,double>;

int main()
{
	typedef Graph<int,int,int> GraphType;
	GraphType *g = new GraphType(/*estimated # of nodes*/ 2, /*estimated # of edges*/ 1); 

	g -> add_node(); 
	g -> add_node(); 

	g -> add_tweights( 0,   /* capacities */  1, 5 );
	g -> add_tweights( 1,   /* capacities */  2, 6 );
	g -> add_edge( 0, 1,    /* capacities */  3, 4 );

	int flow = g -> maxflow();

	printf("Flow = %d\n", flow);
	printf("Minimum cut:\n");
	if (g->what_segment(0) == GraphType::SOURCE)
		printf("node0 is in the SOURCE set\n");
	else
		printf("node0 is in the SINK set\n");
	if (g->what_segment(1) == GraphType::SOURCE)
		printf("node1 is in the SOURCE set\n");
	else
		printf("node1 is in the SINK set\n");

	delete g;

	return 0;
}


