Currently the findEdgeId function consumes a good deal of time. This can be made nearly constant time by creating a hash table which maps from edge pairs, represented as a string, "i j", to the edge id values.
It might be valuable to do this for other edge attributes as well. Ideally we store an Edge struct somewhere with all edge attributes and access it via the "i j" hash.
Currently the
findEdgeId
function consumes a good deal of time. This can be made nearly constant time by creating a hash table which maps from edge pairs, represented as a string, "i j", to the edge id values.It might be valuable to do this for other edge attributes as well. Ideally we store an
Edge
struct somewhere with all edge attributes and access it via the "i j" hash.