Struct libpijul::graph::Graph
[−]
[src]
pub struct Graph { pub lines: Vec<Line>, // some fields omitted }
A graph, representing the whole content of the repository state at
a point in time. The encoding is a "flat adjacency list", where
each vertex contains a index children
and a number of children
n_children
. The children of that vertex are then
&g.children[children .. children + n_children]
.
Fields
lines: Vec<Line>
Array of all alive lines in the graph. Line 0 is a dummy line at the end, so that all nodes have a common successor
Methods
impl Graph
[src]
impl Graph
[src]
fn tarjan(&mut self) -> Vec<Vec<VertexId>>
Tarjan's strongly connected component algorithm, returning a vector of strongly connected components, where each SCC is a vector of vertex indices.
fn dfs(
&mut self,
scc: &[Vec<VertexId>],
dfs: &mut DFS,
forward: &mut Vec<(Key<PatchId>, Edge)>
)
&mut self,
scc: &[Vec<VertexId>],
dfs: &mut DFS,
forward: &mut Vec<(Key<PatchId>, Edge)>
)
Run a depth-first search on this graph, assigning the
first_visit
and last_visit
numbers to each node.
Trait Implementations
impl Debug for Graph
[src]
impl Index<VertexId> for Graph
[src]
type Output = Line
The returned type after indexing
fn index(&self, idx: VertexId) -> &Self::Output
The method for the indexing (container[index]
) operation