Skip to main content

MultiGraph

Struct MultiGraph 

Source
pub struct MultiGraph { /* private fields */ }

Implementations§

Source§

impl MultiGraph

Source

pub fn clone_with_fresh_policy(&self) -> Self

br-r37-c1-7dpyg: structural clone with a FRESH RuntimePolicy — see Graph::clone_with_fresh_policy.

Source

pub fn reorder_rows_for_nx_copy_walk(&mut self)

br-r37-c1-s0d4x: reorder every adjacency row into NetworkX’s MultiGraph.copy() walk order — the multigraph counterpart of Graph::reorder_rows_for_nx_copy_walk (cells move wholesale). A pair’s cells enter both rows at the first u-major touch: row u = earlier-position neighbors sorted by (pos(v), index of u within row v), then the rest (self-loops included) in original order.

Source

pub fn apply_row_orders(&mut self, orders: &[(String, Vec<String>)])

br-r37-c1-u3qyn: restore explicit adjacency row orders (pickle round-trip) — see Graph::apply_row_orders. Multigraph rows are keyed cells (neighbor -> key set); the cells move wholesale.

Source

pub fn new(mode: CompatibilityMode) -> Self

Source

pub fn with_runtime_policy(runtime_policy: RuntimePolicy) -> Self

Source

pub fn strict() -> Self

Source

pub fn hardened() -> Self

Source

pub fn mode(&self) -> CompatibilityMode

Source

pub fn node_count(&self) -> usize

Source

pub fn edge_count(&self) -> usize

Source

pub fn number_of_selfloops(&self) -> usize

Source

pub fn edge_keys(&self, left: &str, right: &str) -> Option<Vec<usize>>

Return edge keys as Vec (needed by Python bindings).

Source

pub fn edge_keys_iter( &self, left: &str, right: &str, ) -> Option<impl Iterator<Item = &usize>>

Return an iterator over keys for edges between left and right.

Source

pub fn revision(&self) -> u64

Source

pub fn has_node(&self, node: &str) -> bool

Source

pub fn has_edge(&self, left: &str, right: &str) -> bool

Source

pub fn nodes_ordered(&self) -> Vec<&str>

Source

pub fn neighbors(&self, node: &str) -> Option<Vec<&str>>

Source

pub fn neighbors_iter( &self, node: &str, ) -> Option<impl Iterator<Item = &str> + '_>

Source

pub fn edge_keys_vec(&self, left: &str, right: &str) -> Vec<usize>

Source

pub fn node_attrs(&self, node: &str) -> Option<&AttrMap>

Source

pub fn edge_attrs( &self, left: &str, right: &str, key: usize, ) -> Option<&AttrMap>

Source

pub fn evidence_ledger(&self) -> &EvidenceLedger

Source

pub fn runtime_policy(&self) -> &RuntimePolicy

Source

pub fn set_runtime_policy(&mut self, runtime_policy: RuntimePolicy)

Source

pub fn is_directed(&self) -> bool

Source

pub fn is_multigraph(&self) -> bool

Source

pub fn degree(&self, node: &str) -> usize

Return the degree of a node (total number of parallel edges incident). Self-loops contribute 2 to the degree each (NetworkX convention).

Source

pub fn add_node(&mut self, node: impl Into<String>) -> bool

Source

pub fn add_node_with_attrs( &mut self, node: impl Into<String>, attrs: AttrMap, ) -> bool

Source

pub fn add_edge( &mut self, left: impl Into<String>, right: impl Into<String>, ) -> Result<usize, GraphError>

Source

pub fn add_edge_with_attrs( &mut self, left: impl Into<String>, right: impl Into<String>, attrs: AttrMap, ) -> Result<usize, GraphError>

Source

pub fn add_edge_with_key_and_attrs( &mut self, left: impl Into<String>, right: impl Into<String>, key: usize, attrs: AttrMap, ) -> Result<usize, GraphError>

Source

pub fn add_fresh_edge_unrecorded( &mut self, left: impl Into<String>, right: impl Into<String>, ) -> Option<usize>

Insert one attribute-free edge for a pair known to have no existing parallel edge bucket. Returns None if the pair already exists.

Source

pub fn add_fresh_edge_with_key_unrecorded( &mut self, left: impl Into<String>, right: impl Into<String>, key: usize, ) -> Option<usize>

Insert one attribute-free edge with an explicit key for a pair known to have no existing parallel edge bucket. Returns None if the pair already exists.

Source

pub fn extend_nodes_with_attrs_unrecorded<I>(&mut self, nodes: I) -> usize
where I: IntoIterator<Item = (String, AttrMap)>,

br-r37-c1-l5ve7: bulk node insert WITH attrs, one ledger record — MultiGraph mirror of MultiDiGraph::extend_nodes_with_attrs_unrecorded. Existing nodes merge attrs (extend).

Source

pub fn extend_keyed_edges_with_attrs_unrecorded<I>(&mut self, edges: I) -> usize
where I: IntoIterator<Item = (String, String, usize, AttrMap)>,

br-r37-c1-l5ve7: bulk KEYED edge insert WITH attrs, one ledger record — MultiGraph mirror of MultiDiGraph::extend_keyed_edges_with_attrs_unrecorded (add_edge_impl pays TWO record_decision calls per edge). Endpoint nodes are created on demand; an existing (u, v, key) cell merges attrs (extend), matching add_edge_with_key_and_attrs.

Source

pub fn extend_fresh_int_prefix_keyed_edges_unrecorded<I>( &mut self, node_count: usize, edges: I, ) -> usize
where I: IntoIterator<Item = (usize, usize, usize)>,

Bulk-load attribute-free keyed edges for a freshly-created integer prefix graph. The caller has already validated that node first-seen order is exactly 0..node_count and that internal keys are sequential per undirected pair, so this builds the string-keyed MultiGraph state directly from indices instead of canonicalizing both endpoints for every edge in the Python boundary layer.

Source

pub fn extend_fresh_index_keyed_edges_with_attrs_unrecorded<I, N>( &mut self, nodes: N, edges: I, ) -> usize
where I: IntoIterator<Item = (usize, usize, usize, AttrMap)>, N: IntoIterator<Item = String>,

Bulk-load attributed keyed edges for a freshly-created integer-indexed graph. The caller has already assigned NetworkX-compatible node labels and per-undirected-pair keys, so this avoids endpoint string hashing in the Python boundary layer while preserving the normal MultiGraph storage layout.

Source

pub fn replace_edge_attrs( &mut self, left: &str, right: &str, key: usize, attrs: AttrMap, ) -> bool

br-r37-c1-sjf4t: overwrite the attribute map for an existing (u, v, key) edge. Returns whether the edge existed.

Source

pub fn replace_node_attrs(&mut self, node: &str, attrs: AttrMap) -> bool

br-r37-c1-sjf4t: overwrite the attribute map for an existing node.

Source

pub fn remove_edge( &mut self, left: &str, right: &str, key: Option<usize>, ) -> bool

Source

pub fn remove_node(&mut self, node: &str) -> bool

Source

pub fn edges_ordered(&self) -> Vec<MultiEdgeSnapshot>

Source

pub fn edges_ordered_borrowed(&self) -> Vec<(&str, &str, usize, &AttrMap)>

Source

pub fn snapshot(&self) -> MultiGraphSnapshot

Trait Implementations§

Source§

impl Clone for MultiGraph

Source§

fn clone(&self) -> MultiGraph

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MultiGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.