## Help with graph pathfinder usage

Code:
```#define INFINITY    (MAX_INT - 1)

typedef struct {
int weight;            /* inútil até agora */
int dest;              /* indica o destino da ligação (ex. 4 -> 6, dest = 6) */
} DijkEdge;

typedef struct {
DijkEdge* connections; /* An array of edges which has this as the starting node (conjunto de ligações deste nodo) */
int numconnect;        /* penso que seja a origem da ligação, no exemplo ali em cima numconnect = 4 (creio) */
int isDead;            /* ""          ""               "" */
} Vertex;

void Dijkstra(Vertex* graph, int nodecount, int source) {
for(int i = 0; i < nodecount; i++) {
if(i == source) {
graph[i].distance = 0;
} else {
graph[i].distance = INFINITY;
}
}
for(int i = 0; i < nodecount; i++) {
int next;
int min = INFINITY+1;
for(int j = 0; j < nodecount; j++) {
if(!graph[j].isDead && graph[j].distance < min) {
next = j;
min = graph[j].distance;
}
}
for(int j = 0; j < graph[next].numconnect; j++) {
if(graph[graph[next].connections[j].dest].distance >
graph[next].distance + graph[next].connections[j].weight)
{
graph[graph[next].connections[j].dest].distance =
graph[next].distance + graph[next].connections[j].weight;
}
}