@@ -15,11 +15,11 @@ var sparse_graph_t = function(){
15
15
/**
16
16
* Object constructor
17
17
*
18
- *
18
+ *
19
19
* The main entry points in the graph object are the two dummy nodes [beg] and [end].
20
20
* Those allow us to write more generic code by handling corner cases implicitly.
21
21
* They allow the addition of a single vertex to the graph in O(1).
22
- * Remark : Indeed the behaviour we want to get is the behaviour of a dll (doubly linked list).
22
+ * Remark : Indeed the behaviour we want to get is the behaviour of a dll (doubly linked list).
23
23
*
24
24
*
25
25
* vertices are small arrays where
@@ -32,14 +32,14 @@ var sparse_graph_t = function(){
32
32
* For the set vertices that have not been removed from the graph,
33
33
* we define the 'youngest' vertex as the most recently added vertex of this set
34
34
* and we define the 'oldest' vertex as the least recently added vertex of this set
35
- *
35
+ *
36
36
* Invariants
37
37
* ==
38
38
*
39
39
* Given the graph is not empty:
40
40
* > [end][1] = pred of end = the youngest vertex
41
41
* > [beg][2] = succ of beg = the oldest vertex
42
- *
42
+ *
43
43
* Given a vertex v
44
44
* > v[1][2] = succ of pred of v = v
45
45
* > v[2][1] = pred of succ of v = v
@@ -60,11 +60,11 @@ var sparse_graph_t = function(){
60
60
/**
61
61
* Prototype method to add a vertex to the graph with label h.
62
62
* <p>
63
- * The graph is extended
64
- * @param h is the label
63
+ * The graph is extended
64
+ * @param { label } h is the label
65
65
*/
66
66
67
- graph . prototype . vadd = function ( h ) {
67
+ graph . prototype . vadd = function ( h ) {
68
68
69
69
// First the vertex is created and appended at the end of the dll.
70
70
// Remember [end][1] was the previous last element
@@ -86,7 +86,7 @@ var sparse_graph_t = function(){
86
86
87
87
this . eitr ( i , function ( e ) { this . edel ( e ) ; } ) ;
88
88
89
-
89
+
90
90
i [ 1 ] [ 2 ] = i [ 2 ] ; // next of pref becomes next
91
91
i [ 2 ] [ 1 ] = i [ 1 ] ; // prev of next becomes prev
92
92
@@ -173,7 +173,7 @@ var sparse_graph_t = function(){
173
173
174
174
} ;
175
175
176
-
176
+
177
177
graph . prototype . aeend = function ( ) { return this . eend ; } ;
178
178
179
179
@@ -182,4 +182,4 @@ var sparse_graph_t = function(){
182
182
183
183
} ;
184
184
185
- exports . sparse_graph_t = sparse_graph_t ;
185
+ exports . sparse_graph_t = sparse_graph_t ;
0 commit comments