All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added the
PermitCycles
option to explicitly prevent the creation of cycles.
- Changed the
Acyclic
option to not implicitly impose cycle checks for operations likeAddEdge
. To prevent the creation of cycles, usePermitCycles
. - Changed
TopologicalSort
to only work for graphs created withPermitCycles
. This is temporary. - Changed
TransitiveReduction
to only work for graphs created withPermitCycles
. This is temporary.
- Added the
Order
method for retrieving the number of vertices in the graph. - Added the
Size
method for retrieving the number of edges in the graph.
- Changed the
graph
logo. - Changed an internal operation of
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 byShortestPath
itself.
- Fixed
draw.DOT
to work correctly with vertices that contain special characters and whitespaces.
- Added the
PredecessorMap
method for obtaining a map with all predecessors of each vertex. - Added the
RemoveEdge
method for removing the edge between two vertices. - Added the
Clone
method for retrieving a deep copy of the graph. - Added the
TopologicalSort
function for obtaining the topological order of the vertices in the graph. - Added the
TransitiveReduction
function for transforming the graph into its transitive reduction.
- Changed the
visit
function ofDFS
to accept a vertex hash instead of the vertex value (i.e.K
instead ofT
). - Changed the
visit
function ofBFS
to accept a vertex hash instead of the vertex value (i.e.K
instead ofT
).
- Removed the
Predecessors
function. UsePredecessorMap
instead and look up the respective vertex.
- Added the
Graph.AddVertex
method for adding a vertex. This replacesGraph.Vertex
. - Added the
Graph.AddEdge
method for creating an edge. This replacesGraph.Edge
. - Added the
Graph.Vertex
method for retrieving a vertex by its hash. This is not to be confused with the oldGraph.Vertex
function for adding vertices that got replaced withGraph.AddVertex
. - Added the
Graph.Edge
method for retrieving an edge. This is not to be confused with the oldGraph.Edge
function for creating an edge that got replaced withGraph.AddEdge
. - Added the
Graph.Predecessors
function for retrieving a vertex' predecessors. - Added the
DFS
function. - Added the
BFS
function. - Added the
CreatesCycle
function. - Added the
StronglyConnectedComponents
function. - Added the
ShortestPath
function. - Added the
ErrEdgeNotFound
error indicating that a desired edge could not be found.
- Removed the
Graph.EdgeByHashes
method. UseGraph.AddEdge
instead. - Removed the
Graph.GetEdgeByHashes
method. UseGraph.Edge
instead. - Removed the
Graph.DegreeByHash
method. UseGraph.Degree
instead. - Removed the
Graph.Degree
method. - Removed the
Graph.DFS
andGraph.DFSByHash
methods. UseDFS
instead. - Removed the
Graph.BFS
andGraph.BFSByHash
methods. UseBFS
instead. - Removed the
Graph.CreatesCycle
andGraph.CreatesCycleByHashes
methods. UseCreatesCycle
instead. - Removed the
Graph.StronglyConnectedComponents
method. UseStronglyConnectedComponents
instead. - Removed the
Graph.ShortestPath
andGraph.ShortestPathByHash
methods. UseShortestPath
instead.
- Added the
EdgeWeight
andEdgeAttribute
functional options. - Added the
Properties
field toEdge
.
- Changed
Edge
to accept a variadicoptions
parameter. - Changed
EdgeByHashes
to accept a variadicoptions
parameter. - Renamed
draw.Graph
todraw.DOT
for more clarity regarding the rendering format.
- Removed the
WeightedEdge
function. UseEdge
with theEdgeWeight
functional option instead. - Removed the
WeightedEdgeByHashes
function. UseEdgeByHashes
with theEdgeWeight
functional option instead.
- Fixed missing edge attributes when drawing a graph using
draw.DOT
.
- Added
draw
package for graph visualization using DOT-compatible renderers. - Added
Traits
function for retrieving the graph's traits.
- Added
AdjacencyMap
function for retrieving an adjancency map for all vertices.
- Removed the
AdjacencyList
function.
- Added
AdjacencyList
function for retrieving an adjacency list for all vertices.
- Updated the examples in the documentation.
- Added
ShortestPath
function for computing shortest paths.
- Changed the term "properties" to "traits" in the code and documentation.
- Don't traverse all vertices in disconnected graphs by design.
- Added
StronglyConnectedComponents
function for detecting SCCs. - Added various images to usage examples.
- Added
Degree
andDegreeByHash
functions for determining vertex degrees. - Added cycle checks when adding an edge using the
Edge
functions.
- Added
CreatesCycle
andCreatesCycleByHashes
functions for predicting cycles.
- Introduced dedicated types for directed and undirected graphs, making
Graph[K, T]
an interface.
- Introduced core types and methods.