Graph theory is outside the scope of this document.
You can represent a graph as a dictionary of lists, where each key is a node, and each value is a list of connected nodes.
graph = {1: [2],
2: [3, 4],
3: [4, 5, 6],
4: [1, 5],
5: [2]}