pub struct OrientedGraph(/* private fields */);Expand description
Loopless oriented graphs.
Every pair of vertices has at most one edge.
Implementations§
Source§impl OrientedGraph
impl OrientedGraph
pub fn as_directed(&self) -> &DirectedGraph
Sourcepub fn new<I>(n: usize, arcs: I) -> Self
pub fn new<I>(n: usize, arcs: I) -> Self
Create an oriented graph with n vertices and arcs in arcs.
§Panics
- If
arcscontains vertices not in{0, ..., n-1} - If a loop
(u, u)is provided - If some arc is provided twice
- If both arcs
(u, v)and(v, u)are provided
use flag_algebra::flags::OrientedGraph;
// Oriented path with 3 vertices `0 -> 1 -> 2`
let p3 = OrientedGraph::new(3, [(0, 1), (1, 2)]);Sourcepub fn empty(n: usize) -> Self
pub fn empty(n: usize) -> Self
Oriented graph with n vertices and no edge.
use flag_algebra::flags::OrientedGraph;
assert_eq!(OrientedGraph::empty(4), OrientedGraph::new(4, []));Sourcepub fn out_nbrs(&self, v: usize) -> Vec<usize>
pub fn out_nbrs(&self, v: usize) -> Vec<usize>
Out-neigborhood of v.
use flag_algebra::flags::OrientedGraph;
let p3 = OrientedGraph::new(3, [(0,1), (1,2)]);
assert_eq!(p3.out_nbrs(1), vec![2]);Sourcepub fn in_nbrs(&self, v: usize) -> Vec<usize>
pub fn in_nbrs(&self, v: usize) -> Vec<usize>
In-neigborhood of v.
use flag_algebra::flags::OrientedGraph;
let p3 = OrientedGraph::new(3, [(0,1), (1,2)]);
assert_eq!(p3.in_nbrs(1), vec![0]);Trait Implementations§
Source§impl Canonize for OrientedGraph
impl Canonize for OrientedGraph
Source§fn invariant_neighborhood(&self, v: usize) -> Vec<Vec<usize>>
fn invariant_neighborhood(&self, v: usize) -> Vec<Vec<usize>>
Return lists of vertices that are invariant isomorphism. Read more
Source§fn apply_morphism(&self, p: &[usize]) -> Self
fn apply_morphism(&self, p: &[usize]) -> Self
Return the result of the action of a permuation
p on the object. Read moreSource§fn invariant_coloring(&self) -> Option<Vec<u64>>
fn invariant_coloring(&self) -> Option<Vec<u64>>
Optionally returns a value for each node that is invariant by isomorphism. Read more
Source§fn canonical_typed(&self, sigma: usize) -> Self
fn canonical_typed(&self, sigma: usize) -> Self
The “typed” objects refers to the case where only
the action of permutations that are constant
on
0..sigma are considered. Read moreSource§fn morphism_to_canonical(&self) -> Vec<usize>
fn morphism_to_canonical(&self) -> Vec<usize>
Source§fn automorphisms(&self) -> AutomorphismIterator<Self>
fn automorphisms(&self) -> AutomorphismIterator<Self>
Iterator on the automorphism group of
g. Read moreSource§fn stabilizer(&self, sigma: usize) -> AutomorphismIterator<Self>
fn stabilizer(&self, sigma: usize) -> AutomorphismIterator<Self>
Source§impl Clone for OrientedGraph
impl Clone for OrientedGraph
Source§fn clone(&self) -> OrientedGraph
fn clone(&self) -> OrientedGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OrientedGraph
impl Debug for OrientedGraph
Source§impl<'de> Deserialize<'de> for OrientedGraph
impl<'de> Deserialize<'de> for OrientedGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for OrientedGraph
impl Display for OrientedGraph
Source§impl Draw for OrientedGraph
impl Draw for OrientedGraph
Source§impl Flag for OrientedGraph
impl Flag for OrientedGraph
Source§const NAME: &'static str = "OrientedGraph"
const NAME: &'static str = "OrientedGraph"
A unique name for this type of flags. For instance “Graph”.
This nameis used for naming the associated data subdirectory.
Source§fn induce(&self, p: &[usize]) -> Self
fn induce(&self, p: &[usize]) -> Self
Returns the subflag induced by the vertices in the slice
set.Source§fn size_zero_flags() -> Vec<Self>
fn size_zero_flags() -> Vec<Self>
Returns the set of all flags of size 0. Read more
Source§fn superflags(&self) -> Vec<Self>
fn superflags(&self) -> Vec<Self>
Source§const HEREDITARY: bool = true
const HEREDITARY: bool = true
Setting this parameter to
false deactivate checks that induced subflags exists.
Must be true in every classic case.Source§fn generate_next(previous: &[Self]) -> Vec<Self>
fn generate_next(previous: &[Self]) -> Vec<Self>
Return the list of flags of size
self.size() + 1 that contain self
as an induced subflag reduced modulo isomorphism.Source§fn generate(n: usize) -> Vec<Self>
fn generate(n: usize) -> Vec<Self>
Return the list of flags of size
n reduced modulo isomorphism.Source§fn generate_typed_up(type_flag: &Self, g_vec: &[Self]) -> Vec<Self>
fn generate_typed_up(type_flag: &Self, g_vec: &[Self]) -> Vec<Self>
Return the list of flags of
g_vec that can be rooted on the
flag type_flag.
Each different way to root this flag give a different flag in the result.Source§fn generate_typed(type_flag: &Self, size: usize) -> Vec<Self>
fn generate_typed(type_flag: &Self, size: usize) -> Vec<Self>
Return the list of flag of size
size rooted on type_flag
reduced modulo (typed) isomorphism.Source§fn select_type(&self, eta: &[usize]) -> Self
fn select_type(&self, eta: &[usize]) -> Self
Reorder self so that the
eta.len() first vertices are the values
of eta in the corresponding order.Source§impl Ord for OrientedGraph
impl Ord for OrientedGraph
Source§fn cmp(&self, other: &OrientedGraph) -> Ordering
fn cmp(&self, other: &OrientedGraph) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OrientedGraph
impl PartialEq for OrientedGraph
Source§impl PartialOrd for OrientedGraph
impl PartialOrd for OrientedGraph
Source§impl Serialize for OrientedGraph
impl Serialize for OrientedGraph
Source§impl SubFlag<OrientedGraph> for TriangleFree
impl SubFlag<OrientedGraph> for TriangleFree
Source§const SUBCLASS_NAME: &'static str = "Triangle-free oriented graph"
const SUBCLASS_NAME: &'static str = "Triangle-free oriented graph"
Unique name for the subclass.
This is used for naming the memoization directory.
Source§fn is_in_subclass(flag: &OrientedGraph) -> bool
fn is_in_subclass(flag: &OrientedGraph) -> bool
Identifier function for the subclass.
const HEREDITARY: bool = F::HEREDITARY
impl Eq for OrientedGraph
impl StructuralPartialEq for OrientedGraph
Auto Trait Implementations§
impl Freeze for OrientedGraph
impl RefUnwindSafe for OrientedGraph
impl Send for OrientedGraph
impl Sync for OrientedGraph
impl Unpin for OrientedGraph
impl UnwindSafe for OrientedGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.