diff --git a/dijkstra.cpp b/dijkstra.cpp new file mode 100644 index 0000000..6898ab7 --- /dev/null +++ b/dijkstra.cpp @@ -0,0 +1,52 @@ +#include +#include /*Used for INT_MAX*/ +using namespace std; +#define vertex 7 /*It is the total no of verteices in the graph*/ +int minimumDist(int dist[], bool Dset[]) /*A method to find the vertex with minimum distance which is not yet included in Dset*/ +{ + int min=INT_MAX,index; /*initialize min with the maximum possible value as infinity does not exist */ + for(int v=0;v