Remove live code & console.log, leave examples as comments (Geometry, Graphs, Maths).

This commit is contained in:
Eric Lavault
2021-10-10 17:55:08 +02:00
parent 29d2a84090
commit 9212e6d684
18 changed files with 198 additions and 216 deletions

View File

@ -47,30 +47,30 @@ function djikstra (graph, V, src) {
return dist
}
const V = 9
const E = [
[0, 1, 4],
[0, 7, 8],
[1, 7, 11],
[1, 2, 8],
[7, 8, 7],
[6, 7, 1],
[2, 8, 2],
[6, 8, 6],
[5, 6, 2],
[2, 5, 4],
[2, 3, 7],
[3, 5, 14],
[3, 4, 9],
[4, 5, 10]
]
export { createGraph, djikstra }
const graph = createGraph(V, E)
const distances = djikstra(graph, V, 0)
// const V = 9
// const E = [
// [0, 1, 4],
// [0, 7, 8],
// [1, 7, 11],
// [1, 2, 8],
// [7, 8, 7],
// [6, 7, 1],
// [2, 8, 2],
// [6, 8, 6],
// [5, 6, 2],
// [2, 5, 4],
// [2, 3, 7],
// [3, 5, 14],
// [3, 4, 9],
// [4, 5, 10]
// ]
// const graph = createGraph(V, E)
// const distances = djikstra(graph, V, 0)
/**
* The first value in the array determines the minimum distance and the
* second value represents the parent node from which the minimum distance has been calculated
*/
console.log(distances)