Graphviz  2.41.20171026.1811
Data Structures | Macros | Typedefs | Functions
dijkstra.c File Reference
#include "bfs.h"
#include "dijkstra.h"
#include <limits.h>
#include <stdlib.h>
Include dependency graph for dijkstra.c:

Go to the source code of this file.

Data Structures

struct  heap
 

Macros

#define MAX_DIST   (double)INT_MAX
 
#define LOOP   while(TRUE)
 
#define left(i)   (2*(i))
 
#define right(i)   (2*(i)+1)
 
#define parent(i)   ((i)/2)
 
#define insideHeap(h, i)   ((i)<h->heapSize)
 
#define greaterPriority(h, i, j, dist)   (dist[h->data[i]]<dist[h->data[j]])
 
#define assign(h, i, j, index)   {h->data[i]=h->data[j]; index[h->data[i]]=i;}
 
#define exchange(h, i, j, index)
 

Typedefs

typedef DistType Word
 

Functions

void dijkstra (int vertex, vtx_data *graph, int n, DistType *dist)
 
int dijkstra_bounded (int vertex, vtx_data *graph, int n, DistType *dist, int bound, int *visited_nodes)
 
void dijkstra_f (int vertex, vtx_data *graph, int n, float *dist)
 

Macro Definition Documentation

#define assign (   h,
  i,
  j,
  index 
)    {h->data[i]=h->data[j]; index[h->data[i]]=i;}

Definition at line 45 of file dijkstra.c.

#define exchange (   h,
  i,
  j,
  index 
)
Value:
{int temp; \
temp=h->data[i]; \
h->data[i]=h->data[j]; \
h->data[j]=temp; \
index[h->data[i]]=i; \
index[h->data[j]]=j; \
}

Definition at line 46 of file dijkstra.c.

#define greaterPriority (   h,
  i,
  j,
  dist 
)    (dist[h->data[i]]<dist[h->data[j]])

Definition at line 44 of file dijkstra.c.

#define insideHeap (   h,
 
)    ((i)<h->heapSize)

Definition at line 43 of file dijkstra.c.

#define left (   i)    (2*(i))

Definition at line 40 of file dijkstra.c.

#define LOOP   while(TRUE)

Definition at line 34 of file dijkstra.c.

#define MAX_DIST   (double)INT_MAX

Definition at line 30 of file dijkstra.c.

Referenced by dijkstra(), and dijkstra_bounded().

#define parent (   i)    ((i)/2)

Definition at line 42 of file dijkstra.c.

#define right (   i)    (2*(i)+1)

Definition at line 41 of file dijkstra.c.

Typedef Documentation

typedef DistType Word

Definition at line 32 of file dijkstra.c.

Function Documentation

void dijkstra ( int  vertex,
vtx_data graph,
int  n,
DistType dist 
)

Definition at line 155 of file dijkstra.c.

References vtx_data::edges, vtx_data::ewgts, INT_MAX, MAX_DIST, and vtx_data::nedges.

Referenced by embed_graph().

int dijkstra_bounded ( int  vertex,
vtx_data graph,
int  n,
DistType dist,
int  bound,
int visited_nodes 
)
void dijkstra_f ( int  vertex,
vtx_data graph,
int  n,
float *  dist 
)

Definition at line 360 of file dijkstra.c.

References vtx_data::edges, MAXFLOAT, N_GNEW, and vtx_data::nedges.