(x, y, v)
| 108 | } |
| 109 | |
| 110 | setEdgeValue (x, y, v) { |
| 111 | let result = false; |
| 112 | |
| 113 | if (defined(this.nodes[x]) && defined(this.nodes[x].edges[y])) { |
| 114 | this.nodes[x].edges[y] = this.nodes[y].edges[x] = defined(v) ? v : null; |
| 115 | result = true; |
| 116 | } |
| 117 | |
| 118 | return result; |
| 119 | } |
| 120 | |
| 121 | setNodeValue (x, v) { |
| 122 | const n = this.nodes[x]; |