pub struct MultiGraph { /* private fields */ }Implementations§
Source§impl MultiGraph
impl MultiGraph
Sourcepub fn clone_with_fresh_policy(&self) -> Self
pub fn clone_with_fresh_policy(&self) -> Self
br-r37-c1-7dpyg: structural clone with a FRESH RuntimePolicy — see Graph::clone_with_fresh_policy.
Sourcepub fn reorder_rows_for_nx_copy_walk(&mut self)
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.
Sourcepub fn apply_row_orders(&mut self, orders: &[(String, Vec<String>)])
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.
pub fn new(mode: CompatibilityMode) -> Self
pub fn with_runtime_policy(runtime_policy: RuntimePolicy) -> Self
pub fn strict() -> Self
pub fn hardened() -> Self
pub fn mode(&self) -> CompatibilityMode
pub fn node_count(&self) -> usize
pub fn edge_count(&self) -> usize
pub fn number_of_selfloops(&self) -> usize
Sourcepub fn edge_keys(&self, left: &str, right: &str) -> Option<Vec<usize>>
pub fn edge_keys(&self, left: &str, right: &str) -> Option<Vec<usize>>
Return edge keys as Vec (needed by Python bindings).
Sourcepub fn edge_keys_iter(
&self,
left: &str,
right: &str,
) -> Option<impl Iterator<Item = &usize>>
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.
pub fn revision(&self) -> u64
pub fn has_node(&self, node: &str) -> bool
pub fn has_edge(&self, left: &str, right: &str) -> bool
pub fn nodes_ordered(&self) -> Vec<&str>
pub fn neighbors(&self, node: &str) -> Option<Vec<&str>>
pub fn neighbors_iter( &self, node: &str, ) -> Option<impl Iterator<Item = &str> + '_>
pub fn edge_keys_vec(&self, left: &str, right: &str) -> Vec<usize>
pub fn node_attrs(&self, node: &str) -> Option<&AttrMap>
pub fn edge_attrs( &self, left: &str, right: &str, key: usize, ) -> Option<&AttrMap>
pub fn evidence_ledger(&self) -> &EvidenceLedger
pub fn runtime_policy(&self) -> &RuntimePolicy
pub fn set_runtime_policy(&mut self, runtime_policy: RuntimePolicy)
pub fn is_directed(&self) -> bool
pub fn is_multigraph(&self) -> bool
Sourcepub fn degree(&self, node: &str) -> usize
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).
pub fn add_node(&mut self, node: impl Into<String>) -> bool
pub fn add_node_with_attrs( &mut self, node: impl Into<String>, attrs: AttrMap, ) -> bool
pub fn add_edge( &mut self, left: impl Into<String>, right: impl Into<String>, ) -> Result<usize, GraphError>
pub fn add_edge_with_attrs( &mut self, left: impl Into<String>, right: impl Into<String>, attrs: AttrMap, ) -> Result<usize, GraphError>
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>
Sourcepub fn add_fresh_edge_unrecorded(
&mut self,
left: impl Into<String>,
right: impl Into<String>,
) -> Option<usize>
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.
Sourcepub fn add_fresh_edge_with_key_unrecorded(
&mut self,
left: impl Into<String>,
right: impl Into<String>,
key: usize,
) -> Option<usize>
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.
Sourcepub fn extend_nodes_with_attrs_unrecorded<I>(&mut self, nodes: I) -> usize
pub fn extend_nodes_with_attrs_unrecorded<I>(&mut self, nodes: I) -> usize
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).
Sourcepub fn extend_keyed_edges_with_attrs_unrecorded<I>(&mut self, edges: I) -> usize
pub fn extend_keyed_edges_with_attrs_unrecorded<I>(&mut self, edges: I) -> usize
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.
Sourcepub fn extend_fresh_int_prefix_keyed_edges_unrecorded<I>(
&mut self,
node_count: usize,
edges: I,
) -> usize
pub fn extend_fresh_int_prefix_keyed_edges_unrecorded<I>( &mut self, node_count: usize, edges: I, ) -> 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.
Sourcepub fn extend_fresh_index_keyed_edges_with_attrs_unrecorded<I, N>(
&mut self,
nodes: N,
edges: I,
) -> usize
pub fn extend_fresh_index_keyed_edges_with_attrs_unrecorded<I, N>( &mut self, nodes: N, edges: I, ) -> usize
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.
Sourcepub fn replace_edge_attrs(
&mut self,
left: &str,
right: &str,
key: usize,
attrs: AttrMap,
) -> bool
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.
Sourcepub fn replace_node_attrs(&mut self, node: &str, attrs: AttrMap) -> bool
pub fn replace_node_attrs(&mut self, node: &str, attrs: AttrMap) -> bool
br-r37-c1-sjf4t: overwrite the attribute map for an existing node.
pub fn remove_edge( &mut self, left: &str, right: &str, key: Option<usize>, ) -> bool
pub fn remove_node(&mut self, node: &str) -> bool
pub fn edges_ordered(&self) -> Vec<MultiEdgeSnapshot>
pub fn edges_ordered_borrowed(&self) -> Vec<(&str, &str, usize, &AttrMap)>
pub fn snapshot(&self) -> MultiGraphSnapshot
Trait Implementations§
Source§impl Clone for MultiGraph
impl Clone for MultiGraph
Source§fn clone(&self) -> MultiGraph
fn clone(&self) -> MultiGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more