I\'m trying to represent a graph like this in Python:
Graph
The basic algorithms is the following, but I have to consider separately cases, where the indices o