forked from algorithm-visualizer/algorithm-visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.js
More file actions
21 lines (16 loc) · 717 Bytes
/
Copy pathdata.js
File metadata and controls
21 lines (16 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function filledArray (length, value) {
return Array.apply (null, Array (length)).map (Number.prototype.valueOf, value);
}
var G = new DirectedGraph.random (5, 0.4),
ranks,
outgoingEdgeCounts = filledArray (G.length, 0),
incomingNodes;
var graphTracer = new DirectedGraphTracer ('Web Page inter-connections'),
rankTracer = new Array1DTracer ('Web Page Ranks'),
oecTracer = new Array1DTracer ('Outgoing Edge Counts'),
inTracer = new Array2DTracer ('Incoming Nodes');
var logger = new LogTracer ();
graphTracer._setData (G);
oecTracer._setData (outgoingEdgeCounts);
for (incomingNodes = []; incomingNodes.length < G.length; incomingNodes.push (filledArray (G.length, -1)));
inTracer._setData (incomingNodes);