[][src]Crate abstractgraph

This crate implements standard graph algorithms without requiring a specific graph representation.

It's quite common for graph structures to be defined implicitly by other data structures. This crate lets you run standard graph algorithms without having to translate your data structures into a specific graph representation.

Usage

To define a graph, implement the DirectedGraph trait on some data structure can be treated as agraph. You can then run the various generic graph algorithms which take a generic type implementing DirectedGraph.

History

This crate began as a port of the aga and agar modules from ccan.

Modules

bfs

Breadth First Search

dfs

Depth First Search

Structs

Neighbors

An iterator through the neighbors of a given node (nodes reachable by a single edge transition from the given node) in a graph.

SimpleEdge

A trivial graph edge representation, whose only information is the destination node

SimpleEdges

A trivial wrapper around an iterator across nodes, changing it to an iterator across SimpleEdges with those nodes as their destinations.

Traits

DirectedGraph

The trait for types (implicitly or explicitly) representing a directed graph structure

OutEdge

The trait for types representing a single graph edge from a known graph node