(path, edge)
| 46 | json.dump(j, f, indent=2) |
| 47 | |
| 48 | def remove_edge(path, edge): |
| 49 | _validate(path) |
| 50 | with open(path, "r") as f: |
| 51 | j = json.load(f) |
| 52 | assert edge in j["E"], "edge not present" |
| 53 | j["E"].remove(edge) |
| 54 | with open(path, "w") as f: |
| 55 | json.dump(j, f, indent=2) |
| 56 | |
| 57 | def add_node(path, node): |
| 58 | _validate(path) |