Graph/SingleSourceShortestPath/singleSourceShortest.cxx File Reference

Dijsktra's Algorithm Implementation

Contains implementatino of Dijkstra's Algorithm. More...

#include <iostream>
#include "BinaryHeap.h"
#include "Graph.h"

Functions

void output (int n, vector< int > &dist, vector< int > &pred)
 Useful debugging function.
void singleSourceShortest (Graph const &g, int s, vector< int > &dist, vector< int > &pred)
 Interface to single source Shortest Path problem.


Detailed Description

Dijsktra's Algorithm Implementation

Contains implementatino of Dijkstra's Algorithm.

Author:
George Heineman
Date:
6/15/08

Function Documentation

void output ( int  n,
vector< int > &  dist,
vector< int > &  pred 
)

Useful debugging function.

void singleSourceShortest ( Graph const &  g,
int  s,
vector< int > &  dist,
vector< int > &  pred 
)

Interface to single source Shortest Path problem.

Parameters:
g the graph to be processed.
s the source vertex from which to compute all paths.
dist array to contain shortest distances to all other vertices.
pred array to contain previous vertices to be able to recompute paths.

Algorithm Development Kit 1.0