#include<iostream.h>
#include<LINK/basic/Set.h>
#include<LINK/graph/Vertex.h>
#include<LINK/graph/HyperGraph.h>
#include<LINK/algorithm/Algorithms.h>

// this simple demo program implements a dummy graph function and calls it

template ostream& operator<<(ostream&, const Collection<Set<Vertex*> >&);

Set<Set<Vertex*> > evenOddRanks(const Graph *g)
{
	const SortedArray<Vertex*>& verts = g->vertices();
	int i, order = g->order();
	Set<Vertex*> even_rank_vertices, odd_rank_vertices;
	for (i=0; i<order; i+=2) {
		even_rank_vertices.insert(verts[i]);
		if (i+1 < order)
			odd_rank_vertices.insert(verts[i+1]);
	}
	Set<Set<Vertex*> > result;
	result.insert(even_rank_vertices);
	result.insert(odd_rank_vertices);
	return result;
}
void main()
{
	HyperGraph h;

	h.addVertices(10);
	Set<Set<Vertex*> >eoranks = evenOddRanks(&h);
	DepthFirstSearch(&h);
	cout << eoranks << endl;
}
