Grab Bag Release: Graphs

Last week, I’ve been to Munich with my girlfriend, celebrating indie comics and her winning the Kurt Schalker Award! 🙂 AND I’ve found some time for working on my graph implementation.

Graphs

Graphs are pairs G = (V, E) where V denotes some set of vertices and E some set of edges between these vertices.

My implementation stores the set of edges of the graph as adjacency list, making it fast at enumerating vertex neighbors, but slows at accessing specific edges for dense graphs (which have many edges between each pair of vertices. It allows adding multiple edges between two vertices, thus being feasible for modeling multi-graphs. Also, it allows creating loops, edges whose source and target vertex are identical.