Returns iterator of all edges in the graph. Each edge is a tuple of [from, to]
. For undirected graphs each edge will only be emitted once.
Only useful for directed graphs. Returns a new graph in which the direction of edges is inverted/flipped. I.e. an edge a -> b
becomes b -> a
.
Resizes matrix to new size given.
new max vertices
Generated using TypeDoc
Adjacency matrix representation for both directed and undirected graphs and using a compact bit matrix to store edges. Each edge requires only 1 bit in directed graphs or 2 bits in undirected graphs. E.g. this is allows storing 16384 directed edges in just 2KB of memory (128 * 128 / 8 = 2048).