A library for creating generic graph data structures and modifying, analyzing, and visualizing them.
APACHE-2.0 License
Bot releases are hidden (Show)
Are you using graph? Check out the graph user survey
AllPathsBetween
function for computing all paths between two vertices.Published by dominikbraun over 1 year ago
StableTopologicalSort
to invoke the less
function as few as possible, reducing comparisons.CreatesCycle
to use an optimized path if the default in-memory store is being used.Published by dominikbraun over 1 year ago
StableTopologicalSort
.Published by dominikbraun over 1 year ago
TopologicalSort
to retain its original performance.Published by dominikbraun over 1 year ago
StableTopologicalSort
function for deterministic topological orderings.VertexAttributes
functional option for setting an entire vertex attributes map.Published by dominikbraun over 1 year ago
BFSWithDepth
function for performing a BFS with depth information.ErrVertexHasEdges
when removing a vertex.Published by dominikbraun over 1 year ago
Release post: graph Version 0.20 Is Out
Graph.AddVerticesFrom
method for adding all vertices from another graph.Graph.AddEdgesFrom
method for adding all edges from another graph.Graph.Edges
method for obtaining all edges as a slice.Graph.UpdateEdge
method for updating the properties of an edge.Store.UpdateEdge
method for updating the properties of an edge.NewLike
function for creating a new graph that is "like" the given graph.EdgeAttributes
functional option for setting an entire edge attributes map.Graph.Clone
to use the built-in in-memory store for storing vertices and edges for cloned graphs.Published by dominikbraun over 1 year ago
MinimumSpanningTree
function for finding a minimum spanning tree.MaximumSpanningTree
function for finding a maximum spanning tree.Published by dominikbraun over 1 year ago
Graph.RemoveVertex
method for removing a vertex.Store.RemoveVertex
method for removing a vertex.ErrVertexHasEdges
error instance.Union
function for combining two graphs into one.Published by dominikbraun over 1 year ago
draw.GraphAttributes
functional option for draw.DOT
for rendering graph attributes.Published by dominikbraun over 1 year ago
ShortestPath
for an edge case.Published by dominikbraun over 1 year ago
TransitiveReduction
not to incorrectly report cycles.Published by dominikbraun over 1 year ago
This release contains breaking changes to the public API (see "Changed").
Store
interface, introducing support for custom storage implementations.NewWithStore
function for explicitly initializing a graph with a Store
instance.EdgeData
functional option that can be used with AddEdge
, introducing support for arbitrary data.Data
field to EdgeProperties
for retrieving data added using EdgeData
.Order
to additionally return an error instance (breaking change).Size
to additionally return an error instance (breaking change).Published by dominikbraun over 1 year ago
ShortestPath
to return ErrTargetNotReachable
if the target vertex is not reachable.ShortestPath
to return correct results for large unweighted graphs.Published by dominikbraun almost 2 years ago
ErrVertexAlreadyExists
error instance. Use errors.Is
to check for this instance.ErrEdgeAlreadyExists
error instance. Use errors.Is
to check for this instance.ErrEdgeCreatesCycle
error instance. Use errors.Is
to check for this instance.AddVertex
to return ErrVertexAlreadyExists
if the vertex already exists.VertexWithProperties
to return ErrVertexNotFound
if the vertex doesn't exist.AddEdge
to return ErrVertexNotFound
if either vertex doesn't exist.AddEdge
to return ErrEdgeAlreadyExists
if the edge already exists.AddEdge
to return ErrEdgeCreatesCycle
if cycle prevention is active and the edge would create a cycle.Edge
to return ErrEdgeNotFound
if the edge doesn't exist.RemoveEdge
to return the error instances returned by Edge
.Published by dominikbraun almost 2 years ago
ErrVertexNotFound
error instance.TopologicalSort
to fail at runtime when a cycle is detected.TransitiveReduction
to return the transitive reduction as a new graph and fail at runtime when a cycle is detected.Vertex
to return ErrVertexNotFound
if the desired vertex couldn't be found.Published by dominikbraun about 2 years ago
VertexProperties
type for storing vertex-related properties.VertexWithProperties
method for retrieving a vertex and its properties.VertexWeight
functional option that can be used for AddVertex
.VertexAttribute
functional option that can be used for AddVertex
.draw.DOT
.AddVertex
to accept functional options.PermitCycles
to PreventCycles
. This seems to be the price to pay if English isn't a library author's native language.ShortestPath
when the target vertex is not reachable from one of the visited vertices.Published by dominikbraun about 2 years ago
PermitCycles
option to explicitly prevent the creation of cycles.Acyclic
option to not implicitly impose cycle checks for operations like AddEdge
. To prevent the creation of cycles, use PermitCycles
.TopologicalSort
to only work for graphs created with PermitCycles
. This is temporary.TransitiveReduction
to only work for graphs created with PermitCycles
. This is temporary.Published by dominikbraun about 2 years ago
Order
method for retrieving the number of vertices in the graph.Size
method for retrieving the number of edges in the graph.graph
logo.ShortestPath
from O(n) to O(log(n)) by implementing the priority queue as a binary heap. Note that the actual complexity might still be defined by ShortestPath
itself.draw.DOT
to work correctly with vertices that contain special characters and whitespaces.Published by dominikbraun about 2 years ago
PredecessorMap
method for obtaining a map with all predecessors of each vertex.RemoveEdge
method for removing the edge between two vertices.Clone
method for retrieving a deep copy of the graph.TopologicalSort
function for obtaining the topological order of the vertices in the graph.TransitiveReduction
function for transforming the graph into its transitive reduction.visit
function of DFS
to accept a vertex hash instead of the vertex value (i.e. K
instead of T
).visit
function of BFS
to accept a vertex hash instead of the vertex value (i.e. K
instead of T
).Predecessors
function. Use PredecessorMap
instead and look up the respective vertex.