(graph)
| 22 | } |
| 23 | |
| 24 | function randomLayout(graph) { |
| 25 | let layout = []; |
| 26 | for (let i = 0; i < graph.size; i++) { |
| 27 | layout.push(new Vec(Math.random() * 1000, |
| 28 | Math.random() * 1000)); |
| 29 | } |
| 30 | return layout; |
| 31 | } |
| 32 | |
| 33 | function gridGraph(size) { |
| 34 | let grid = new Graph(); |