diff options
author | JSDurand <mmemmew@gmail.com> | 2023-01-05 10:24:39 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2023-01-05 10:24:39 +0800 |
commit | 7dd4935230e303aef8d295d992239d59d95b32d7 (patch) | |
tree | 486104820b5f3701518c1030a0393a5cef428cb9 /graph/src/labelled/mod.rs | |
parent | bdbd4b4dc21af09711c97d3f903877443199af06 (diff) |
singly labelled graphs
Now I have a new type of labelled graphs, which can index vertices by
labels, but not index edges by labels. The biggest difference is that
I do not have to keep a hashmap of edge targets by labels, and I do
not have to guard against the duplication of nodes with the same set
of edges. I guard against nodes with the same label, though.
Also, in this graph, both vertices and edges have one label at a time,
whereas in the previous labelled graph there can be a multitude of
edges between the same source and target nodes, but with different
labels.
Now it remains to test this type of graphs, and to think through how
we attach forest fragments to nondeterministic finite automata edges,
and how to join forest fragments together while skipping nullable
edges, in order to finish the "compilation" part.
Diffstat (limited to 'graph/src/labelled/mod.rs')
-rw-r--r-- | graph/src/labelled/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/graph/src/labelled/mod.rs b/graph/src/labelled/mod.rs new file mode 100644 index 0000000..61e3014 --- /dev/null +++ b/graph/src/labelled/mod.rs @@ -0,0 +1,20 @@ +#![warn(missing_docs)] +//! This file implements a labelled graph. See the trait +//! [`LabelGraph`][crate::LabelGraph] for details. +//! +//! Since the method +//! [`find_children_with_label`][super::LabelGraph::find_children_with_label] +//! needs to be implemented efficiently, we store the mappings between +//! labels and edges in both directions. + +use std::ops::{Deref, DerefMut}; + +use crate::{builder::Builder, error::Error, Graph, GraphLabel, LabelExtGraph, LabelGraph}; + +pub mod double; + +pub use double::{DLGBuilder, DLGraph}; + +pub mod single; + +pub use single::SLGraph; |