#include "Mesh.h"

struct Node{
	int meshId;
	vector <int> neighbors;
	vector<double> distances;
	int prev;
	int next;
	double currDist;
	bool isVisited;
};


class Graph
{
public:
	vector<Mesh*> allmeshes;
	vector<Node*> nodes;

	void readMeshes(string folder,int noofmeshes,string format);

	vector<Node*> createPath(string filename, int noofelems, int startNode, int endNode, int partindex);
	void shortestPath(vector<Node*> graph, int startid);

	vector<Node*> printPath(vector<Node*> graph, int startid, int endid);
	void WritePartDists(string filename, vector<vector<int>>& part_verts);
	void initPath(string filename, int noofelems, int startNode, int endNode, int partindex);
	void writeDists(string filename);
	void center_all();

private:
};

class mycomparison
{
public:
	bool operator() (const Node* lhs, const Node* rhs) const
	{
		return (lhs->currDist > rhs->currDist);
	}
};
