Skip to content

Commit

Permalink
tabs -> spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tcsc committed Jul 7, 2014
1 parent 12ace4c commit a2a2c7d
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions examples/Dijkstra/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import std.stdio;

void main()
{
alias Graph = AdjacencyList!(VecS, VecS, DirectedS, char, string);
alias Graph = AdjacencyList!(VecS, VecS, DirectedS, char, string);

Graph graph;
auto a = graph.addVertex('a');
Graph graph;
auto a = graph.addVertex('a');
auto b = graph.addVertex('b');
auto c = graph.addVertex('c');
auto d = graph.addVertex('d');
Expand All @@ -29,20 +29,19 @@ void main()
weight[graph.addEdge(c, b, "c -> b").edge] = 7;
weight[graph.addEdge(c, d, "c -> d").edge] = 3;
weight[graph.addEdge(d, e, "d -> e").edge] = 1;
weight[graph.addEdge(e, a, "e -> a").edge] = 1;
weight[graph.addEdge(e, b, "e -> b").edge] = 1;

auto colourMap = new Colour[graph.vertexCount];
auto distance = new real[graph.vertexCount];
auto predecessor = new Graph.VertexDescriptor[graph.vertexCount];
dijkstraShortestPaths(graph, a, weight, predecessor,
NullDijkstraVisitor!Graph(),
colourMap,
distance);


foreach(v; graph.vertices) {
writeln(graph[v], " - Distance: ", distance[v],
", Predecessor: ", graph[predecessor[v]]);
}
weight[graph.addEdge(e, a, "e -> a").edge] = 1;
weight[graph.addEdge(e, b, "e -> b").edge] = 1;

auto colourMap = new Colour[graph.vertexCount];
auto distance = new real[graph.vertexCount];
auto predecessor = new Graph.VertexDescriptor[graph.vertexCount];
dijkstraShortestPaths(graph, a, weight, predecessor,
NullDijkstraVisitor!Graph(),
colourMap,
distance);

foreach(v; graph.vertices) {
writeln(graph[v], " - Distance: ", distance[v],
", Predecessor: ", graph[predecessor[v]]);
}
}

0 comments on commit a2a2c7d

Please sign in to comment.