Journalism In The Past

Project Management Forms/Templates

free illustration project management project free image on pixabay microsoft project online review 2026 features pros cons pricing project management in education edexec council members push for renegotiation of 21 million incentive package microsoft project online is retiring what you do next matters more new microsoft 365 project and planner features geeky gadgets project search helps young people see their own potential project finance highways today project finance highways today project a closes fund v at 278m project finance highways today the project announces surprise return in new format after being axed oil and gas project management 6 global challenges reshaping delivery best free project management software of 2025 techradar reshaping project management in 2025 trends and innovations to watch project development funds boost the viability of ppp project finance agile project management trends shaping 2026 ams construction project management certification 5 exam prep courses for 40 mashable project management phases explained free images white building project art children fun creativity project meeting planning sign free stock photo public domain pictures clipart project idea clipart project schedule clipart projects proyectos svg cut together strategy society free svg image icon svg silh learnosm svg planning strategy growth quality free svg image icon svg silh learnosm for students

:
Aesthetic Insta Story Ideas
Add Dijkstra.
1 parent Gift Cards That Can Be Used Anywhere commit c97e472

Free illustration project management project free image on pixabay 2 files changed Credit Cards For Fair Credit Instant Approval

Lines changed: 15 additions & 2 deletions

Please Visit Our Blog Post Project Management Forms/Templates

src/algorithms/graph/dijkstra/__test__/dijkstra.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('dijkstra', () => {
4343
.addEdge(edgeFG)
4444
.addEdge(edgeEG);
4545

46-
const distances = dijkstra(graph, vertexA);
46+
const { distances, previousVertices } = dijkstra(graph, vertexA);
4747

4848
expect(distances).toEqual({
4949
H: Infinity,
@@ -55,5 +55,11 @@ describe('dijkstra', () => {
5555
G: 12,
5656
F: 11,
5757
});
58+
59+
expect(previousVertices.F.getKey()).toBe('D');
60+
expect(previousVertices.D.getKey()).toBe('B');
61+
expect(previousVertices.B.getKey()).toBe('A');
62+
expect(previousVertices.G.getKey()).toBe('E');
63+
expect(previousVertices.C.getKey()).toBe('A');
5864
});
5965
});

src/algorithms/graph/dijkstra/dijkstra.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import PriorityQueue from '../../../data-structures/priority-queue/PriorityQueue
77
export default function dijkstra(graph, startVertex) {
88
const distances = {};
99
const visitedVertices = {};
10+
const previousVertices = {};
1011
const queue = new PriorityQueue();
1112

1213
// Init all distances with infinity assuming that currently we can't reach
@@ -38,6 +39,9 @@ export default function dijkstra(graph, startVertex) {
3839
if (queue.hasValue(neighbor)) {
3940
queue.changePriority(neighbor, distances[neighbor.getKey()]);
4041
}
42+
43+
// Remember previous vertex.
44+
previousVertices[neighbor.getKey()] = currentVertex;
4145
}
4246

4347
// Add neighbor to the queue for further visiting.
@@ -51,5 +55,8 @@ export default function dijkstra(graph, startVertex) {
5155
visitedVertices[currentVertex.getKey()] = currentVertex;
5256
}
5357

54-
return distances;
58+
return {
59+
distances,
60+
previousVertices,
61+
};
5562
}

Credit Cards For Fair Instant Approval Project Management Forms/Templates

Comments
 (0)