(x, y)
| 4 | } |
| 5 | |
| 6 | add (x, y) { |
| 7 | let result = false; |
| 8 | |
| 9 | if (defined(this.nodes[x]) && defined(this.nodes[y])) { |
| 10 | this.nodes[x].edges[y] = this.nodes[y].edges[x] = null; |
| 11 | result = true; |
| 12 | } |
| 13 | |
| 14 | return result; |
| 15 | } |
| 16 | |
| 17 | adjacent (x, y) { |
| 18 | const n = this.nodes[x]; |