#include <stdbool.h>
#include <stdlib.h>
-#define MAX_DIST (double)INT_MAX
-
typedef DistType Word;
+#define MAX_DIST ((DistType)INT_MAX)
+
/* This heap class is suited to the Dijkstra alg.
data[i]=vertexNum <==> index[vertexNum]=i
*/
/* initial distances with edge weights: */
for (i = 0; i < n; i++)
- dist[i] = (DistType) MAX_DIST;
+ dist[i] = MAX_DIST;
dist[vertex] = 0;
for (i = 1; i < graph[vertex].nedges; i++)
dist[graph[vertex].edges[i]] = (DistType) graph[vertex].ewgts[i];
/* initial distances with edge weights: */
for (i = 0; i < n; i++) /* far, TOO COSTLY (O(n))! */
- dist[i] = (DistType) MAX_DIST;
+ dist[i] = MAX_DIST;
dist[vertex] = 0;
for (i = 1; i < graph[vertex].nedges; i++)
dist[graph[vertex].edges[i]] = (DistType) graph[vertex].ewgts[i];