Get real with the purpose of the GraphI Interface: implement additional, optimised graph types.
Adjacency Matrix: A literal NxN matrix storing the edge values between nodes (row/column). Probably works only with integer valued nodes.
Provide a graph[int, int]->number optimisation using numpy arrays.
Offer a wrapper to transform arbitrary nodes to indices.
Adjacency Mapping: Combination of AdjacencyGraph and an Adjacency Matrix, for sparse graphs and any hashable nodes. Store a Dict[Node] -> List[Node] for neighbours of a node, and a Dict[Node, Node] -> Object for values of edges.
We can probably calculate/estimate the savings/cost. See stackoverflow for the behaviour of dict.
Get real with the purpose of the GraphI Interface: implement additional, optimised graph types.
graph[int, int]->number
optimisation usingnumpy
arrays.AdjacencyGraph
and an Adjacency Matrix, for sparse graphs and any hashable nodes. Store aDict[Node] -> List[Node]
for neighbours of a node, and aDict[Node, Node] -> Object
for values of edges.dict
.