Going through refactoring. Don't use it yet.
Package goraph implements graph, tree data structures and algorithms with visualization.
goraph is a set of packages for graph, tree database analytics in Go, with handcrafted testing data and visualizations. It was my first coding project written from scratch. This is an ongoing project with no time-line.
For fast query and retrieval, please check out Cayley.
Tree (a graph G with V vertices) if and only if it satisfies any of the following 5 conditions:
- G has V-1 edges and no cycles
- G has V-1 edges and is connected
- G is connected, and removing any edge disconnects the - G
- G is acyclic, and adding any edge creates a cycle in G
- Exactly one simple path connects each pair of vertices in G
Degree of a vertex(node): number of edges adjacent to the vertex(loop counts as 2)
Adjacency List vs. Adjacency Matrix
- When Graph G = (V, E) = (Vertex, Edge)
- |V| = # of nodes(vertices), |E| = # of edges
- Sparse graph: |E| is much less than |V|^2, Relatively few edges present
- Dense graph: |E| is close to |V|^2, Relatively few edges missing
- Adjacency List is good for Sparse graph
- Adjacency List uses memory in proportion to |E| so fast to iterate with fewer |E| (but slower for lookup)
- Adjacency Matrix is good for Dense graph
- Adjacency Matrix uses O(|V|^2) memory so fast lookup of edge presence but slow to iterate
README.md Updated at 2015-03-14 21:57:32