remove deletes edges that make up the given paths from the graph.
(paths [][]int)
| 234 | |
| 235 | // remove deletes edges that make up the given paths from the graph. |
| 236 | func (g graph) remove(paths [][]int) { |
| 237 | for _, p := range paths { |
| 238 | for i, u := range p[:len(p)-1] { |
| 239 | delete(g[u], p[i+1]) |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | // subgraph returns a subgraph of g induced by {s, s+1, ... , n}. The |
| 245 | // subgraph is destructively generated in g. |