Crates.io | graaf |
lib.rs | graaf |
version | |
source | src |
created_at | 2024-03-30 15:06:09.080279 |
updated_at | 2024-10-08 14:00:37.4745 |
description | Work with directed graphs. |
homepage | |
repository | https://github.com/bsdrks/graaf |
max_upload_size | |
id | 1191151 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Rust-powered directed graphs.
Add this to your Cargo.toml
:
[dependencies]
graaf = "0.104.0"
AdjacencyListWeighted
represents digraphs as a vector of maps.AdjacencyMatrix
represents digraphs as a matrix using a bit vector.AdjacencyList
represents digraphs as a vector of sets.AdjacencyMap
represents digraphs as a map of sets.EdgeList
represents digraphs as a vector of tuples.Biclique
generates a complete bipartite digraph.Circuit
generates a circuit digraph.Complete
generates a complete digraph.Cycle
generates a bidirectional circuit.Empty
generates a digraph without arcs.ErdosRenyi
generates a random digraph.GrowingNetwork
generates a growing network digraph.Path
generates a path digraph.RandomTournament
generates a random tournament.Star
generates a star digraph.Wheel
generates a wheel digraph.AddArcWeighted
adds an arc to an arc-weighted digraph.AddArc
adds an arc to an unweighted digraph.ArcWeight
returns an arc's weight.ArcsWeighted
iterates over a digraph's weighted arcs.Arcs
iterates over a digraph's arcs.Complement
returns a digraph's complement.Converse
returns a digraph's converse.DegreeSequence
iterates over a digraph's degrees.Degree
returns a vertex's degree.FilterVertices
filters a digraph's vertices.HasArc
checks whether a digraph contains an arc.HasEdge
checks whether a digraph contains an edge.HasWalk
checks whether a digraph contains a walk.InNeighbors
iterates over a vertex's in-neighbors.IndegreeSequence
iterates over a digraph's indegrees.Indegree
returns a vertex's indegree.IsBalanced
checks whether a digraph is balanced.IsComplete
checks whether a digraph is complete.IsIsolated
checks whether a vertex is isolated.IsOriented
checks whether a digraph is oriented.IsPendant
checks whether a vertex is a pendant.IsRegular
checks whether a digraph is regular.IsSemicomplete
checks whether a digraph is semicomplete.IsSimple
checks whether a digraph is simple.IsSpanningSubdigraph
checks whether a digraph spans a superdigraph.IsSubdigraph
checks whether a digraph is a subdigraph.IsSuperdigraph
checks whether a digraph is a superdigraph.IsSymmetric
checks whether a digraph is symmetric.IsTournament
checks whether a digraph is a tournament.Order
returns the number of vertices in a digraph.OutNeighborsWeighted
iterates over a vertex's weighted out-neighbors.OutNeighbors
iterates over a vertex's out-neighbors.OutdegreeSequence
iterates over a digraph's outdegrees.Outdegree
returns a vertex's outdegree.RemoveArc
removes an arc from a digraph.SemidegreeSequence
iterates over a digraph's semidegrees.Sinks
iterates over a digraph's sinks.Size
returns the number of arcs in a digraph.Sources
iterates over a digraph's sources.Union
returns the union of two digraphs.Vertices
iterates over a digraph's vertices.The Bellman-Ford-Moore algorithm finds the shortest distances from a source vertex to all other vertices in an arc-weighted digraph with negative weights.
BellmanFordMoore::distances
finds the shortest distances.A breadth-first search explores an unweighted digraph's vertices in order of their distance from a source.
Bfs
iterates the vertices.BfsDist
iterates the vertices and their distance from the source.BfsPred
iterates the vertices and their predecessors.BfsDist::distances
finds the shortest distances.BfsPred::cycles
returns the cycles along the shortest path.BfsPred::predecessors
finds the predecessors.BfsPred::shortest_path
finds the shortest path.A depth-first search explores an unweighted digraph's vertices in order of their depth from a source.
Dfs
iterates the vertices.DfsDist
iterates the vertices and their distance from the source.DfsPred
iterates the vertices and their predecessors.DfsPred::predecessors
finds the predecessors.Dijkstra's algorithm finds the shortest paths in an arc-weighted digraph.
Dijkstra
iterates the vertices.DijkstraDist
iterates the vertices.DijkstraPred
iterates the vertices and their predecessors.DijkstraDist::distances
finds the shortest distances.DijkstraPred::predecessors
finds the predecessors.DijkstraPred::shortest_path
finds the shortest path.A DistanceMatrix
contains the shortest distances between all vertex pairs in a digraph.
DistanceMatrix::center
finds the digraph's center.DistanceMatrix::diameter
finds the digraph's diameter.DistanceMatrix::eccentricities
returns the vertices' eccentricities.DistanceMatrix::is_connected
checks the digraph's connectedness.DistanceMatrix::periphery
finds the digraph's periphery.The Floyd-Warshall algorithm finds the distance between each vertex pair in an arc-weighted digraph.
FloydWarshall::distances
finds the shortest distances.Johnson's circuit-finding algorithm finds all circuits in a digraph.
Johnson75::circuits
finds all circuits.A PredecessorTree
contains the vertex predecessors.
PredecessorTree::search
finds a vertex by value.PredecessorTree::search_by
finds a vertex by predicate.Tarjan's algorithm finds strongly connected components in a digraph.
Tarjan::components
finds strongly connected components.See CHANGELOG.md for a list of changes.
Licensed under Apache License, Version 2.0 or MIT license at your option.
Feel free to reach out with questions or suggestions.