From 60e57f370ce844c7affce69ec9cddaf91a17a2ec Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sun, 7 Jul 2024 21:55:34 +0200 Subject: [PATCH 01/12] Publish IntMap type --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index ee67538..e6261f9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,3 +14,4 @@ pub use graph::{Graph, NodeId, EdgeId, Weight}; pub use random_walk::RandomWalk; pub use rank::{MeritRank, Neighbors}; pub use walk_storage::{WalkStorage, WalkId}; +pub use integer_hasher::IntMap; From b1261eca0b8c7e08744f0e1bc279824bf58a6910 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sun, 7 Jul 2024 22:37:41 +0200 Subject: [PATCH 02/12] Add MERITRANK_NO_ASSERT compile time option --- README.md | 2 ++ src/constants.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 72bb28a..fbfcebd 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ MeritRank is a Rust library for computing merit scores and rankings in a directe Original `meritrank` is maintained by [Vladimir Radkevich](https://github.com/vsradkevich). +## Compilation options +- `MERITRANK_NO_ASSERT=1` - disable runtime asserts for better performance. diff --git a/src/constants.rs b/src/constants.rs index 7bc2ef7..f2fb0bf 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,4 +1,4 @@ -pub const ASSERT : bool = true; +pub const ASSERT : bool = std::option_env!("MERITRANK_NO_ASSERT").is_none(); pub const VERBOSE : bool = true; pub const OPTIMIZE_INVALIDATION : bool = true; pub const EPSILON : f64 = 1e-6; From f1f2e385c670d8240bfbd361e659989ddb5b3a0a Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Tue, 16 Jul 2024 03:37:09 +0200 Subject: [PATCH 03/12] Fix incorrect error value --- src/rank.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rank.rs b/src/rank.rs index 90d1312..3a60fa0 100644 --- a/src/rank.rs +++ b/src/rank.rs @@ -99,7 +99,7 @@ impl MeritRank { pub fn get_ranks(&self, ego: NodeId, limit: Option) -> Result, MeritRankError> { let counter = self.personal_hits.get(&ego) - .ok_or(MeritRankError::NodeDoesNotExist)?; + .ok_or(MeritRankError::NodeIsNotCalculated)?; let mut peer_scores: Vec<_> = counter.keys().iter() .map(|&peer| self.get_node_score(ego, peer).map(|score| (peer, score))) From 5a83c79e8111d25e5dec8b27ee11dc9115e0f930 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Tue, 16 Jul 2024 09:48:12 +0200 Subject: [PATCH 04/12] Add Clone trait --- src/rank.rs | 1 + src/walk_storage.rs | 3 ++- tests/test_meritrank.rs | 30 ++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/rank.rs b/src/rank.rs index 3a60fa0..8025b2e 100644 --- a/src/rank.rs +++ b/src/rank.rs @@ -17,6 +17,7 @@ pub enum Neighbors { Negative, } +#[derive(Clone)] pub struct MeritRank { pub graph: Graph, walks: WalkStorage, diff --git a/src/walk_storage.rs b/src/walk_storage.rs index 20381b7..47fe4a0 100644 --- a/src/walk_storage.rs +++ b/src/walk_storage.rs @@ -3,13 +3,14 @@ use rand::prelude::*; use integer_hasher::IntMap; -use crate::constants::{OPTIMIZE_INVALIDATION}; +use crate::constants::OPTIMIZE_INVALIDATION; use crate::graph::{NodeId, EdgeId, Weight}; use crate::random_walk::RandomWalk; pub type WalkId = usize; /// Represents a storage container for walks in the MeritRank graph. +#[derive(Clone)] pub struct WalkStorage { visits: IntMap>, walks: Vec, diff --git a/tests/test_meritrank.rs b/tests/test_meritrank.rs index a162028..b44f4d7 100644 --- a/tests/test_meritrank.rs +++ b/tests/test_meritrank.rs @@ -60,6 +60,36 @@ mod tests { } } + #[test] + fn test_clone_basic_chain_graph() { + let mut rank_ref = MeritRank::new(Graph::<()>::new()).unwrap(); + rank_ref.add_node(0, ()); + let walk_count = 10000; + + let mut rank = MeritRank::new(Graph::<()>::new()).unwrap(); + rank.add_node(0, ()); + rank.calculate(0, walk_count).unwrap(); + for n in 1..8 + { + rank_ref.add_node(n, ()); + rank_ref.add_edge(n-1, n, 1.0); + rank.add_node(n, ()); + rank.add_edge(n-1, n, 1.0); + + } + rank_ref.add_edge(8,1, 1.0); + rank.add_edge(8,1, 1.0); + let cloned = rank.clone(); + rank_ref.calculate(0, walk_count).unwrap(); + println! ("{:?}", cloned.get_ranks(0, None)); + for n in 1..8 + { + let ref_score = rank_ref.get_node_score(0, n).unwrap() as f64; + let score = cloned.get_node_score(0, n).unwrap() as f64; + assert_approx_eq!(ref_score, score , 0.1); + } + } + #[test] fn test_too_early_cut_position_bug() { From f73a6dbd3d513e011a73a9e19c6062893f37f124 Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Sat, 13 Jul 2024 21:42:25 +0200 Subject: [PATCH 05/12] Add perf-related .gitignore entries --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 7aa7025..51b94cb 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,8 @@ Cargo.lock *.pdb .idea + + +dhat-heap.json +flamegraph.svg +perf.data* From d8f84a5158664e75205e43ea1ee555b51a7287c7 Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Wed, 17 Jul 2024 23:45:24 +0200 Subject: [PATCH 06/12] Removed petgraph --- Cargo.toml | 2 +- src/errors.rs | 7 +- src/graph.rs | 452 ++------ src/lib.rs | 4 +- src/main.rs | 35 +- src/random_walk.rs | 1 + src/rank.rs | 131 +-- tests/test_dumps.rs | 24 +- tests/test_meritrank.rs | 64 +- tests/test_smoke.rs | 2156 +++++++++++++++++++-------------------- 10 files changed, 1271 insertions(+), 1605 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cd9f181..228d87b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,12 +20,12 @@ crate-type = ["cdylib", "rlib"] [dependencies] rand = "0.8" -petgraph = "0.6.3" once_cell = "1.8.0" integer-hasher = "0.1.1" intset = "1.0.2" tinyset = "0.4.15" indexmap = "2.2.6" +log = "0.4.22" [dev-dependencies] csv = "1.1.6" diff --git a/src/errors.rs b/src/errors.rs index 2354f35..68ea879 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -8,10 +8,12 @@ pub enum MeritRankError { NodeIdParseError, NodeIsNotCalculated, InvalidWalkLength, - InvalidNode, + NodeNotFound, WalkNotFound, + EdgeNotFound, } + use std::error::Error; use std::fmt::{Display, Formatter, Result}; @@ -25,8 +27,9 @@ impl Display for MeritRankError { MeritRankError::NodeIdParseError => write!(f, "Node ID parse error"), MeritRankError::NodeIsNotCalculated => write!(f, "Node is not calculated"), MeritRankError::InvalidWalkLength => write!(f, "Invalid walk length"), - MeritRankError::InvalidNode => write!(f, "Invalid node"), + MeritRankError::NodeNotFound => write!(f, "Can't find the node with the given ID"), MeritRankError::WalkNotFound => write!(f, "Can't find the walk with the given ID"), + MeritRankError::EdgeNotFound => write!(f, "Can't find the edge between given nodes"), } } } diff --git a/src/graph.rs b/src/graph.rs index 7e8c210..cf6e086 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -1,420 +1,108 @@ -use std::collections::HashMap; use integer_hasher::IntMap; -use petgraph::algo::has_path_connecting; -use petgraph::graph::DiGraph; -use petgraph::graph::{EdgeIndex, NodeIndex}; - -#[allow(unused_imports)] -use petgraph::visit::EdgeRef; +use log::error; use crate::errors::MeritRankError; pub type NodeId = usize; pub type Weight = f64; pub type EdgeId = (NodeId, NodeId); -#[derive(Debug, Clone)] -pub struct Graph { - graph : DiGraph, - nodes : IntMap, +#[derive(PartialEq, Eq)] +pub enum Neighbors { + //All, + Positive, + Negative, } -#[allow(dead_code)] -impl Graph { - /// Creates a new empty `Graph`. - pub fn new() -> Self { - // Initialize a new Graph with an empty directed graph and an empty mapping of NodeId to NodeIndex - Graph { - graph : DiGraph::::new(), - nodes : IntMap::default(), - } - } +#[derive(Debug, Clone, Default)] +pub struct NodeData{ + pos_edges: IntMap, + neg_edges: IntMap, +} - /// Checks if the graph is empty. - pub fn is_empty(&self) -> bool { - self.graph.node_count() == 0 - } - /// Adds a node to the graph and returns its `NodeIndex`. - pub fn add_node( - &mut self, - node : NodeId, - data : NodeData - ) -> NodeIndex { - // Add a node to the graph and store its NodeIndex in the nodes mapping - let index = self.graph.add_node(node.clone()); - self.nodes.insert(node, (index, data)); - index - } - /// Retrieves the `NodeIndex` and `NodeData` of a node in the graph based on its `NodeId`. - pub fn get_node_info( - &self, - node_id : NodeId - ) -> Option<(NodeIndex, NodeData)> { - // Get the NodeIndex from the nodes mapping based on the given NodeId - self.nodes.get(&node_id).cloned().or_else(|| { - // If the NodeIndex is not found in the mapping, iterate over all node indices in the graph - // and find the first node with a matching NodeId - match self.graph - .node_indices() - .find(|&index| self.graph[index] == node_id) { - Some(index) => Some((index, NodeData::default())), - None => None, - } - }) - } - /// Updates the index of nodes in the graph. - pub fn update_index(&mut self) { - // FIXME - // Skip when NodeData is empty type. - let all_data : HashMap = self.nodes - .iter() - .map(|(_, (index, data))| (*index, *data)) - .collect(); +impl NodeData { + pub fn neighbors(&self, mode: Neighbors) -> &IntMap { + match mode { + //Neighbors::All => Some((nbr, weight)), + Neighbors::Positive => &self.pos_edges, + Neighbors::Negative => &self.neg_edges, + //_ => None, + } + } +} - // Update the nodes mapping by iterating over all node indices in the graph - // and mapping their NodeId to the corresponding NodeIndex +#[derive(Debug, Clone)] +pub struct Graph { + nodes: Vec, +} - self.nodes = self.graph - .node_indices() - .map(|index| (self.graph[index], (index, *all_data.get(&index).unwrap_or(&NodeData::default())))) - .collect(); +impl Graph { + pub fn new() -> Self { + Graph { + nodes: Vec::new(), + } + } + pub fn get_new_nodeid(&mut self) -> NodeId { + self.nodes.push(NodeData::default()); + self.nodes.len()-1 } /// Checks if a node with the given `NodeId` exists in the graph. pub fn contains_node(&self, node_id: NodeId) -> bool { // Check if the given NodeId exists in the nodes mapping - self.get_node_info(node_id).is_some() + self.nodes.get(node_id).is_some() } - /// Checks if an edge between the two given nodes exists in the graph. - pub fn contains_edge(&self, source: NodeId, target: NodeId) -> bool { - // Check if the source and target nodes have valid NodeIndices in the graph - if let (Some((source_index, _)), Some((target_index, _))) = - (self.get_node_info(source), self.get_node_info(target)) - { - // Check if there is an edge between the source and target NodeIndices - self.graph.contains_edge(source_index, target_index) - } else { - false + pub fn add_edge(&mut self, from: NodeId, to: NodeId, weight: Weight)->Result<(), MeritRankError> { + if !self.contains_node(to){ + return Err(MeritRankError::NodeNotFound); } - } - - /// Adds an edge between the two given nodes in the graph. - pub fn add_edge(&mut self, source: NodeId, target: NodeId, weight: Weight) { - // Check if the source and target nodes have valid NodeIndices in the graph - if let (Some((source_index, _)), Some((target_index, _))) = - (self.get_node_info(source), self.get_node_info(target)) - { - // Add an edge between the source and target NodeIndices with the given weight - self.graph.add_edge(source_index, target_index, weight); + let node = self.nodes.get_mut(from).ok_or(MeritRankError::NodeNotFound)?; + if from == to { + error!("Trying to add self-reference edge to node {}", from); + return Err(MeritRankError::SelfReferenceNotAllowed); } - } - - /// Removes the edge between the two given nodes from the graph. - pub fn remove_edge(&mut self, source: NodeId, target: NodeId) { - // Check if the source and target nodes have valid NodeIndices in the graph - if let (Some((source_index, _)), Some((target_index, _))) = - (self.get_node_info(source), self.get_node_info(target)) - { - // Find the edge index between the source and target NodeIndices and remove it from the graph - if let Some(edge_index) = self.graph.find_edge(source_index, target_index) { - self.graph.remove_edge(edge_index); - } - } - } - - /// Retrieves the neighboring nodes of a given node. - pub fn neighbors(&self, ego: NodeId) -> Vec { - // Get the NodeIndex of the ego node from the nodes mapping - self.get_node_info(ego) - .map(|(ego_index, _)| { - // Get the neighboring NodeIndices of the ego node in the graph - // and retrieve their corresponding NodeIds - self.graph - .neighbors(ego_index) - .map(|neighbor_index| self.graph[neighbor_index]) - .collect() - }) - .unwrap_or_else(Vec::new) - } - - /// Retrieves the edges of the graph. - /// - /// This method returns a vector of tuples representing the edges connected to the specified `ego` node. - /// Each tuple contains the source node, destination node, and weight of the edge. - /// If the `ego` node does not exist in the graph or there are no edges connected to it, `None` is returned. - /// - /// # Arguments - /// - /// * `ego` - The node for which to retrieve the edges. - /// - /// # Returns - /// - /// A vector of tuples representing the edges connected to the specified `ego` node, - /// or `None` if the `ego` node does not exist in the graph or there are no edges connected to it. - pub fn edges(&self, ego: NodeId) -> Option> { - // Return None if the ego node does not exist in the graph - // or if there are no edges connected to it - // Get the NodeIndex of the ego node from the nodes mapping - self.get_node_info(ego).and_then(|(ego_index, _)| { - // Get the edges of the graph and filter out the edges that do not have the ego node as source - let ego_edges = self.graph.edges(ego_index); - let filtered_edges = ego_edges.filter(|edge| edge.source() == ego_index); - - // Collect the filtered edges into a vector of tuples - let collected_edges: Vec<_> = filtered_edges - .map(|edge| { - // Get the target NodeIndex and weight of the edge - let target_index = edge.target(); - let weight = edge.weight().clone(); - - // Get the NodeId of the target node from the nodes mapping - let target = self.graph[target_index]; - - (ego, target, weight) - }) - .collect(); - - if collected_edges.is_empty() { - None - } else { - Some(collected_edges) - } - }) - } - - /// Checks if there is a path between the two given nodes. - pub fn is_connecting(&self, source: NodeId, target: NodeId) -> bool { - // Check if the source and target nodes have valid NodeIndices in the graph - if let (Some((source_index, _)), Some((target_index, _))) = - (self.get_node_info(source), self.get_node_info(target)) - { - // Use the `has_path_connecting` function from the petgraph library to check if there is a path - // between the source and target NodeIndices in the graph - has_path_connecting(&self.graph, source_index, target_index, None) - } else { - false - } - } - - /// Checks if the graph contains any self-reference and returns an error if found. - pub fn check_self_reference(&self) -> Result<(), MeritRankError> { - // Iterate over all node indices in the graph and check if any node has a self-reference - for node in self.graph.node_indices() { - if self.graph.contains_edge(node, node) { - return Err(MeritRankError::SelfReferenceNotAllowed); + match weight { + 0.0 => { + node.pos_edges.remove(&to); + node.neg_edges.remove(&to); + }, + w if w > 0.0 => { + node.pos_edges.insert(to, weight); + }, + _ => { + node.neg_edges.insert(to, weight); } } Ok(()) } - /// Retrieves the weight of the edge between the two given nodes. - pub fn edge_weight(&self, source: NodeId, target: NodeId) -> Option { - // Check if the source and target nodes have valid NodeIndices in the graph - if let (Some((source_index, _)), Some((target_index, _))) = - (self.get_node_info(source), self.get_node_info(target)) - { - // Find the edge index between the source and target NodeIndices - // and retrieve the corresponding weight if it exists - self.graph - .find_edge(source_index, target_index) - .and_then(|edge_index| self.graph.edge_weight(edge_index).copied()) - } else { - None - } + pub fn get_node_data(&self, node_id: NodeId) -> Option<&NodeData>{ + self.nodes.get(node_id) } - // Experimental - pub fn add_node_by_id(&mut self, node_id : NodeId, data : NodeData) -> NodeIndex { - // Add a node to the graph and store its NodeIndex in the nodes mapping - let index = self.graph.add_node(node_id); - self.nodes.insert(node_id, (index, data)); - index - } - pub fn add_node_by_id_if_not_exists(&mut self, node_id : NodeId, data : NodeData) -> NodeIndex { - match self.get_node_info(node_id) { - Some((index, _)) => Some(index), - None => None, - }.unwrap_or_else(|| self.add_node_by_id(node_id, data)) - } - - /// Sets an edge between the two given nodes in the graph AND create nodes if needed. - pub fn upsert_edge_with_nodes( - &mut self, - source : NodeId, - src_data : NodeData, - target : NodeId, - dst_data : NodeData, - weight : Weight, - ) -> Result<(), MeritRankError> { - let _ = self.add_node_by_id_if_not_exists(source, src_data); - let _ = self.add_node_by_id_if_not_exists(target, dst_data); - self.upsert_edge(source, target, weight) - } - /// Sets an edge between the two given nodes in the graph. - pub fn upsert_edge( - &mut self, - source : NodeId, - target : NodeId, - weight : Weight, - ) -> Result<(), MeritRankError> { - // Check if the source and target nodes have valid NodeIndices in the graph - if let (Some((source_index, _)), Some((target_index, _))) = - (self.get_node_info(source), self.get_node_info(target)) - { - // Add an edge between the source and target NodeIndices with the given weight - self.graph.update_edge(source_index, target_index, weight); - Ok(()) - } else { - Err(MeritRankError::InvalidNode) + /// Removes the edge between the two given nodes from the graph. + pub fn remove_edge(&mut self, from: NodeId, to: NodeId)->Result { + let node = self.nodes.get_mut(from).ok_or(MeritRankError::NodeNotFound)?; + // This is slightly inefficient. More efficient would be to only try removing pos, + // and get to neg only if pos_weight is None. + let pos_weight = node.pos_edges.remove(&to); + let neg_weight = node.neg_edges.remove(&to); + assert!(!(pos_weight.is_some() && neg_weight.is_some())); + Ok(pos_weight.or(neg_weight).expect("Edge not found")) + } + + pub fn edge_weight(&self, from: NodeId, to: NodeId) -> Result, MeritRankError> { + let node = self.nodes.get(from).ok_or(MeritRankError::NodeNotFound)?; + if !self.contains_node(to){ + return Err(MeritRankError::NodeNotFound); } - } - - pub fn all(&self) -> (Vec, Vec<(NodeId, NodeId, Weight)>) { - let (nodes, edges) = - self.graph.clone().into_nodes_edges(); - ( - nodes - .iter() - .map(|n| n.weight) - .collect(), - edges - .iter() - .map(|e| { - (self.index2node(e.source()), self.index2node(e.target()), e.weight) - }) - .collect() - ) - } - - pub fn outgoing(&self, focus_id: NodeId) -> Vec<(EdgeIndex, NodeIndex, NodeId)> { - self.get_node_info(focus_id) - .map(|(focus_index, _)| { - self.graph - .edges_directed(focus_index, petgraph::Direction::Outgoing) - .into_iter() - .map(|e| { - (e.id(), e.target(), self.index2node(e.target())) - } - ) - .collect() - }) - .unwrap_or_else(Vec::new) - } - - pub fn connected(&self, focus_id: NodeId) -> Vec<(EdgeIndex, NodeId, NodeId)> { - self.get_node_info(focus_id) - .map(|(focus_index, _)| { - self.graph - .edges(focus_index) - .into_iter() - .map(|e| { - if e.source()==focus_index { - (e.id(), focus_id, self.index2node(e.target())) - } else if e.target()==focus_index { - (e.id(), self.index2node(e.source()), focus_id) - } else { - panic!("Unexpected edge at connected: {:?}", e) - } - } - ) - .collect() - }) - .unwrap_or_else(Vec::new) - } - - pub fn no_path(&self, start : NodeId, goal : NodeId) -> Option { - let (start_index, _) = self.get_node_info(start)?; - let (goal_index, _) = self.get_node_info(goal)?; - let goal_op = Some(goal_index); - let path = - petgraph::algo::dijkstra( - &self.graph, - start_index, - goal_op, - |eref| { *eref.weight() }); - - Some( !path.contains_key(&goal_index) ) - } - - pub fn shortest_path(&self, start : NodeId, goal : NodeId) -> Option> { - let (start_index, _) = self.get_node_info(start)?; - let (goal_index, _) = self.get_node_info(goal)?; - let (_, v) = - petgraph::algo::astar( - &self.graph, - start_index, - |finish| finish == goal_index, - |e| *e.weight(), - |_| 0.0f64 - )?; - let result: Vec = - v - .iter() - .map(|&idx| self.index2node(idx)) - .collect(); - - Some(result) - } - - /// Returns the number of nodes in the graph - pub fn node_count(&self) -> usize { - self.graph.node_count() - } - - /// Clears the graph. - pub fn clear(&mut self) { - self.graph.clear(); - self.nodes.clear(); - } - - /// NodeIndex --> NodeId - pub fn index2node(&self, index : NodeIndex) -> NodeId { - self.graph[index] // "syntax index" + Ok(node.pos_edges.get(&to).or(node.neg_edges.get(&to))) } } -impl PartialEq for Graph { - fn eq(&self, other: &Self) -> bool { - // Check if the number of nodes and edges are equal - if self.graph.node_count() != other.graph.node_count() - || self.graph.edge_count() != other.graph.edge_count() - { - return false; - } - - // Compare nodes - for node in self.graph.node_indices() { - let node1 = &self.graph[node]; - let node2 = &other.graph[node]; - - if node1 != node2 { - return false; - } - } - - // Compare edges - for edge in self.graph.edge_references() { - let source = edge.source(); - let target = edge.target(); - let &weight1 = edge.weight(); - let weight2 = other - .graph - .edge_weight(other.graph.find_edge(source, target).unwrap()); - if let Some(w2) = weight2 { - if weight1 != *w2 { - return false; - } - } else { - return false; - } - } - - true - } -} diff --git a/src/lib.rs b/src/lib.rs index e6261f9..23ce3f7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,8 +10,8 @@ pub mod walk_storage; pub use counter::{Counter, CounterIterator}; pub use errors::MeritRankError; -pub use graph::{Graph, NodeId, EdgeId, Weight}; +pub use graph::{Graph, NodeId, EdgeId, Weight, Neighbors}; pub use random_walk::RandomWalk; -pub use rank::{MeritRank, Neighbors}; +pub use rank::{MeritRank}; pub use walk_storage::{WalkStorage, WalkId}; pub use integer_hasher::IntMap; diff --git a/src/main.rs b/src/main.rs index 9e16245..ba2cc22 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,26 +7,29 @@ // println!("Invalidation optimization enabled"); // } -use meritrank::{MeritRank, Graph}; +use meritrank::{MeritRank, Graph, NodeId}; fn main() { println!("Hello, world!"); // create graph - let mut graph = Graph::<()>::new(); + let mut graph = Graph::new(); - // add nodes - graph.add_node(1, ()); - graph.add_node(2, ()); - graph.add_node(3, ()); - graph.add_node(4, ()); - graph.add_edge(1, 2, 0.98); - graph.add_edge(2, 3, 1.0); - graph.add_edge(3, 4, 1.0); + + let mut nodes: Vec = Vec::new(); + + for n in 0..5{ + nodes.push(graph.get_new_nodeid()); + + } + + graph.add_edge(nodes[1], nodes[2], 0.98); + graph.add_edge(nodes[2], nodes[3], 1.0); + graph.add_edge(nodes[3], nodes[4], 1.0); // create merit rank - let mut newrank = match MeritRank::<()>::new(graph) { + let mut newrank = match MeritRank::new(graph) { Ok(g) => { println!("Graph created"); g @@ -48,16 +51,16 @@ fn main() { println!("Node scores: {:?}", node_scores); - newrank.add_node(5, ()); + nodes.push(newrank.get_new_nodeid()); println!("Adding edges 2 -> 4"); - newrank.add_edge(2, 4, 1.0); + newrank.add_edge(nodes[2], nodes[4], 1.0); println!("Adding edges 3 -> 4"); - newrank.add_edge(3, 4, -1.0); + newrank.add_edge(nodes[3], nodes[4], -1.0); println!("Adding edges 4 -> 5"); - newrank.add_edge(4, 5, 1.0); + newrank.add_edge(nodes[4], nodes[5], 1.0); println!("Adding edges 3 -> 5"); - newrank.add_edge(3, 5, -1.0); + newrank.add_edge(nodes[3], nodes[5], -1.0); // calculate merit rank let ratings = newrank diff --git a/src/random_walk.rs b/src/random_walk.rs index 22fd32e..3f6767f 100644 --- a/src/random_walk.rs +++ b/src/random_walk.rs @@ -294,6 +294,7 @@ impl RandomWalk { let mut negs = neg_weights.clone(); let mut accumulated_penalty = 0.0; + // TODO: optimize by removing cloning for &step in self.nodes.iter().rev() { if let Some(penalty) = negs.remove(&step) { accumulated_penalty += penalty; diff --git a/src/rank.rs b/src/rank.rs index 8025b2e..619bb15 100644 --- a/src/rank.rs +++ b/src/rank.rs @@ -5,30 +5,22 @@ use tinyset::SetUsize; use crate::constants::{EPSILON, ASSERT, OPTIMIZE_INVALIDATION}; use crate::common::sign; use crate::errors::MeritRankError; -use crate::graph::{Graph, NodeId, Weight}; +use crate::graph::{Graph, Neighbors, NodeId, Weight}; use crate::random_walk::RandomWalk; use crate::walk_storage::{WalkId, WalkStorage}; use crate::counter::Counter; -#[derive(PartialEq, Eq)] -pub enum Neighbors { - All, - Positive, - Negative, -} - #[derive(Clone)] -pub struct MeritRank { - pub graph: Graph, +pub struct MeritRank { + pub graph: Graph, walks: WalkStorage, personal_hits: IntMap, neg_hits: IntMap>, pub alpha: Weight, } -impl MeritRank { - pub fn new(graph: Graph) -> Result { - graph.check_self_reference()?; +impl MeritRank { + pub fn new(graph: Graph) -> Result { Ok(Self { graph, walks: WalkStorage::new(), @@ -38,36 +30,28 @@ impl MeritRank { }) } - pub fn neighbors_weighted(&self, node: NodeId, mode: Neighbors) -> Option> { - let neighbors: IntMap<_, _> = self.graph - .neighbors(node) - .into_iter() - .filter_map(|nbr| { - let weight = self.graph.edge_weight(node, nbr)?; - match mode { - Neighbors::All => Some((nbr, weight)), - Neighbors::Positive if weight > 0.0 => Some((nbr, weight)), - Neighbors::Negative if weight < 0.0 => Some((nbr, weight)), - _ => None, - } - }) - .collect(); - - (!neighbors.is_empty()).then_some(neighbors) - } pub fn calculate(&mut self, ego: NodeId, num_walks: usize) -> Result<(), MeritRankError> { - if !self.graph.contains_node(ego) { - return Err(MeritRankError::NodeDoesNotExist); - } + let negs = self.graph + .get_node_data(ego) + .ok_or(MeritRankError::NodeDoesNotExist)? + .neighbors(Neighbors::Negative); self.walks.drop_walks_from_node(ego); - let negs = self.neighbors_weighted(ego, Neighbors::Negative).unwrap_or_default(); self.personal_hits.insert(ego, Counter::new()); for _ in 0..num_walks { let new_walk_id = self.walks.get_next_free_walkid(); - self.perform_walk(new_walk_id, ego); + //self.perform_walk(new_walk_id, ego); + + let new_segment = self.generate_walk_segment(ego, false).unwrap(); + let walk = self.walks.get_walk_mut(new_walk_id).unwrap(); + assert_eq!(walk.len(), 0); + walk.push(ego); + walk.extend(&new_segment); + + + let walk = self.walks.get_walk(new_walk_id).unwrap(); self.personal_hits.entry(ego) @@ -86,9 +70,7 @@ impl MeritRank { let hits = counter.get_count(&target).copied().unwrap_or(0.0); - if ASSERT && hits > 0.0 && !self.graph.is_connecting(ego, target) { - return Err(MeritRankError::NoPathExists); - } + //if ASSERT && hits > 0.0 && !self.graph.is_connecting(ego, target) { return Err(MeritRankError::NoPathExists); } let default_int_map = IntMap::default(); // Create a longer-lived binding @@ -113,20 +95,19 @@ impl MeritRank { Ok(peer_scores.clone().into_iter().take(limit.unwrap_or(peer_scores.len())).collect()) } - pub fn perform_walk(&mut self, walk_id: WalkId, start_node: NodeId) { - let new_segment = self.generate_walk_segment(start_node, false).unwrap(); - let walk = self.walks.get_walk_mut(walk_id).unwrap(); - assert_eq!(walk.len(), 0); - walk.push(start_node); - walk.extend(&new_segment); - } - pub fn generate_walk_segment(&self, start_node: NodeId, mut skip_alpha: bool) -> Result, MeritRankError> { let mut node = start_node; let mut segment = Vec::new(); let mut rng = thread_rng(); - while let Some(neighbors) = self.neighbors_weighted(node, Neighbors::Positive) { + loop{ + let neighbors = self.graph + .get_node_data(node) + .ok_or(MeritRankError::NodeDoesNotExist)? + .neighbors(Neighbors::Positive); + if neighbors.is_empty() { + break; + } if skip_alpha || rng.gen::() <= self.alpha { skip_alpha = false; let (peers, weights): (Vec<_>, Vec<_>) = neighbors.iter().unzip(); @@ -149,9 +130,9 @@ impl MeritRank { pub fn update_penalties_for_edge(&mut self, src: NodeId, dest: NodeId, remove_penalties: bool) { - let weight = self.graph.edge_weight(src, dest).unwrap(); + let weight = self.graph.edge_weight(src, dest).expect("Node not found!").expect("Edge not found!"); let ego_neg_hits = self.neg_hits.entry(src).or_default(); - let neg_weights: IntMap = [(dest, weight)].iter().cloned().collect(); + let neg_weights: IntMap = std::iter::once((dest, *weight)).collect::>(); // Create a default IntMap to use if get_visits_through_node returns None let default_int_map = IntMap::default(); @@ -216,15 +197,14 @@ impl MeritRank { Ok(()) } - - pub fn add_node(&mut self, node: NodeId, data: NodeData) { - self.graph.add_node(node, data); + pub fn get_new_nodeid(&mut self) -> NodeId { + self.graph.get_new_nodeid() } pub fn add_edge(&mut self, src: NodeId, dest: NodeId, weight: f64) { assert_ne!(src, dest, "Self reference not allowed"); - let old_weight = self.graph.edge_weight(src, dest).unwrap_or(0.0); + let old_weight = *self.graph.edge_weight(src, dest).expect("Node should exist!").unwrap_or(&0.0); if old_weight == weight { return; } @@ -246,8 +226,10 @@ impl MeritRank { assert!(weight >= 0.0); let step_recalc_probability = if OPTIMIZE_INVALIDATION && weight > EPSILON && self.graph.contains_node(src) { - let sum_of_weights: f64 = self.neighbors_weighted(src, Neighbors::Positive) - .unwrap_or_default() + let sum_of_weights: f64 = self.graph + .get_node_data(src) + .unwrap() + .neighbors(Neighbors::Positive) .values() .sum(); weight / (sum_of_weights + weight) @@ -256,26 +238,25 @@ impl MeritRank { }; let invalidated_walks_ids = self.walks.invalidate_walks_through_node(src, Some(dest), step_recalc_probability); - let mut negs_cache: IntMap> = IntMap::default(); for (uid, visit_pos) in &invalidated_walks_ids { let walk = self.walks.get_walk(*uid).unwrap(); - let negs = negs_cache - .entry(walk.first_node().unwrap()) - .or_insert_with(|| self.neighbors_weighted(walk.first_node().unwrap(), Neighbors::Negative).unwrap_or_default()); + let negs = self.graph.get_node_data( + walk.first_node().unwrap()) + .unwrap() + .neighbors(Neighbors::Negative); let cut_position = *visit_pos + 1; revert_counters_for_walk_from_pos(&mut self.personal_hits, walk, cut_position); - if !negs.is_empty() { - update_negative_hits(&mut self.neg_hits, walk, negs, true); - } + update_negative_hits(&mut self.neg_hits, walk, negs, true); } + if weight <= EPSILON { - self.graph.remove_edge(src, dest); + self.graph.remove_edge(src, dest).unwrap(); } else { - self.graph.add_edge(src, dest, weight); + self.graph.add_edge(src, dest, weight).unwrap(); } for (walk_id, visit_pos) in &invalidated_walks_ids { @@ -287,11 +268,11 @@ impl MeritRank { let walk_updated = self.walks.get_walk(*walk_id).unwrap(); let first_node = walk_updated.first_node().unwrap(); - if let Some(negs) = negs_cache.get(&first_node) { - if !negs.is_empty() { - update_negative_hits(&mut self.neg_hits, walk_updated, negs, false); - } - } + + let negs = self.graph.get_node_data(first_node) + .unwrap() + .neighbors(Neighbors::Negative); + update_negative_hits(&mut self.neg_hits, walk_updated, negs, false); } if ASSERT { @@ -309,7 +290,7 @@ impl MeritRank { .collect(); assert_eq!(walks.len(), *count as usize); - assert!(*count == 0.0 || weight <= EPSILON || self.graph.is_connecting(*ego, *peer)); + //assert!(*count == 0.0 || weight <= EPSILON || self.graph.is_connecting(*ego, *peer)); } } } @@ -346,16 +327,6 @@ impl MeritRank { self.zn(src, dest, weight); } - pub fn get_edge(&self, src: NodeId, dest: NodeId) -> Option { - self.graph.edge_weight(src, dest) - } - - pub fn get_node_data(&self, ego: NodeId) -> Result { - self.graph.get_node_info(ego) - .map(|(_, data)| data) - .ok_or(MeritRankError::NodeDoesNotExist) - } - pub fn print_walks(&self) { self.walks.print_walks(); } diff --git a/tests/test_dumps.rs b/tests/test_dumps.rs index b71ccd7..f772945 100644 --- a/tests/test_dumps.rs +++ b/tests/test_dumps.rs @@ -108,11 +108,11 @@ mod tests { let rank2: f64 = record[11].trim().parse()?; // Create the complete graph - let mut complete_graph = Graph::<()>::new(); + let mut complete_graph = Graph::new(); let incremental_node_ids: Vec = vec![0, 1, 2]; for node_id in incremental_node_ids { - complete_graph.add_node(node_id, ()); + complete_graph.get_new_nodeid(); } complete_graph.add_edge(0, 1, w0_1); @@ -207,11 +207,11 @@ mod tests { let rank3: f64 = record[18].trim().parse()?; // Create the complete graph - let mut complete_graph = Graph::<()>::new(); + let mut complete_graph = Graph::new(); let node_ids: Vec = vec![0, 1, 2, 3]; for node_id in &node_ids { - complete_graph.add_node(*node_id, ()); + complete_graph.get_new_nodeid(); } complete_graph.add_edge(0, 1, w0_1); @@ -273,7 +273,7 @@ mod tests { let reader = BufReader::new(File::open(file_path)?); let mut csv_reader = ReaderBuilder::new().from_reader(reader); - let mut meritrank_opt : Option> = None; + let mut meritrank_opt : Option = None; let records_to_skip = 0; for (index, result) in csv_reader.records().enumerate() { @@ -300,10 +300,10 @@ mod tests { // then recalculate merit rank for updated graph meritrank.add_edge(source, destination, weight); } else { - let mut graph = Graph::<()>::new(); - graph.add_node(0, ()); - graph.add_node(1, ()); - graph.add_node(2, ()); + let mut graph = Graph::new(); + graph.get_new_nodeid(); + graph.get_new_nodeid(); + graph.get_new_nodeid(); let weights: Vec = record .iter() @@ -374,7 +374,7 @@ mod tests { let reader = BufReader::new(decoder); let mut csv_reader = ReaderBuilder::new().from_reader(reader); - let mut meritrank_opt: Option> = None; + let mut meritrank_opt: Option = None; for result in csv_reader.records() { let record = result?; @@ -388,11 +388,11 @@ mod tests { // then recalculate merit rank for updated graph meritrank.add_edge(source, destination, weight); } else { - let mut graph = Graph::<()>::new(); + let mut graph = Graph::new(); let node_ids: Vec = vec![0, 1, 2, 3]; for &node_id in &node_ids { - graph.add_node(node_id, ()); + graph.get_new_nodeid(); } let weights: Vec = record diff --git a/tests/test_meritrank.rs b/tests/test_meritrank.rs index b44f4d7..8389984 100644 --- a/tests/test_meritrank.rs +++ b/tests/test_meritrank.rs @@ -16,7 +16,7 @@ mod tests { // lets write test for new(graph: MyGraph) -> Result #[test] fn test_new() { - let graph = Graph::<()>::new(); + let graph = Graph::new(); let result = MeritRank::new(graph); assert!(result.is_ok()); } @@ -24,7 +24,7 @@ mod tests { // lets write test for get_personal_hits(&self) -> &HashMap #[test] fn test_get_personal_hits() { - let graph = Graph::<()>::new(); + let graph = Graph::new(); let merit_rank = MeritRank::new(graph).unwrap(); let result = merit_rank.get_personal_hits(); assert!(result.is_empty()); @@ -33,18 +33,18 @@ mod tests { #[test] fn test_basic_chain_graph() { - let mut rank_ref = MeritRank::new(Graph::<()>::new()).unwrap(); - rank_ref.add_node(0, ()); + let mut rank_ref = MeritRank::new(Graph::new()).unwrap(); + rank_ref.get_new_nodeid(); let walk_count = 10000; - let mut rank = MeritRank::new(Graph::<()>::new()).unwrap(); - rank.add_node(0, ()); + let mut rank = MeritRank::new(Graph::new()).unwrap(); + rank.get_new_nodeid(); rank.calculate(0, walk_count).unwrap(); - for n in 1..8 + for n in 1..9 { - rank_ref.add_node(n, ()); + rank_ref.get_new_nodeid(); rank_ref.add_edge(n-1, n, 1.0); - rank.add_node(n, ()); + rank.get_new_nodeid(); rank.add_edge(n-1, n, 1.0); } @@ -62,18 +62,18 @@ mod tests { #[test] fn test_clone_basic_chain_graph() { - let mut rank_ref = MeritRank::new(Graph::<()>::new()).unwrap(); - rank_ref.add_node(0, ()); + let mut rank_ref = MeritRank::new(Graph::new()).unwrap(); + rank_ref.get_new_nodeid(); let walk_count = 10000; - let mut rank = MeritRank::new(Graph::<()>::new()).unwrap(); - rank.add_node(0, ()); + let mut rank = MeritRank::new(Graph::new()).unwrap(); + rank.get_new_nodeid(); rank.calculate(0, walk_count).unwrap(); - for n in 1..8 + for n in 1..9 { - rank_ref.add_node(n, ()); + rank_ref.get_new_nodeid(); rank_ref.add_edge(n-1, n, 1.0); - rank.add_node(n, ()); + rank.get_new_nodeid(); rank.add_edge(n-1, n, 1.0); } @@ -95,10 +95,10 @@ mod tests { let walk_count = 10000; - let mut ref_rank = MeritRank::new(Graph::<()>::new()).unwrap(); - ref_rank.add_node(0, ()); - ref_rank.add_node(1, ()); - ref_rank.add_node(2, ()); + let mut ref_rank = MeritRank::new(Graph::new()).unwrap(); + ref_rank.get_new_nodeid(); + ref_rank.get_new_nodeid(); + ref_rank.get_new_nodeid(); ref_rank.add_edge(0, 1, -1.0); ref_rank.add_edge(0, 2, 1.0); ref_rank.add_edge(1, 2, 1.0); @@ -107,10 +107,10 @@ mod tests { ref_rank.add_edge(2, 0, 1.0); ref_rank.calculate(0, walk_count).unwrap(); - let mut rank = MeritRank::new(Graph::<()>::new()).unwrap(); - rank.add_node(0, ()); - rank.add_node(1, ()); - rank.add_node(2, ()); + let mut rank = MeritRank::new(Graph::new()).unwrap(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(0, 1, -1.0); rank.add_edge(0, 2, 1.0); rank.add_edge(1, 2, 1.0); @@ -137,19 +137,19 @@ mod tests { let walk_count = 10000; - let mut ref_rank = MeritRank::new(Graph::<()>::new()).unwrap(); - ref_rank.add_node(0, ()); - ref_rank.add_node(1, ()); - ref_rank.add_node(2, ()); + let mut ref_rank = MeritRank::new(Graph::new()).unwrap(); + ref_rank.get_new_nodeid(); + ref_rank.get_new_nodeid(); + ref_rank.get_new_nodeid(); ref_rank.add_edge(0, 2, 1.0); ref_rank.add_edge(1, 0, 1.0); ref_rank.add_edge(2, 1, 1.0); ref_rank.calculate(0, walk_count).unwrap(); - let mut rank = MeritRank::new(Graph::<()>::new()).unwrap(); - rank.add_node(0, ()); - rank.add_node(1, ()); - rank.add_node(2, ()); + let mut rank = MeritRank::new(Graph::new()).unwrap(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(0, 1, -1.0); rank.add_edge(0, 2, 1.0); rank.add_edge(1, 0, 1.0); diff --git a/tests/test_smoke.rs b/tests/test_smoke.rs index 106d1e0..519c1b5 100644 --- a/tests/test_smoke.rs +++ b/tests/test_smoke.rs @@ -5,475 +5,475 @@ mod tests { #[test] fn smoke_perf() { - let mut rank = MeritRank::new(Graph::<()>::new()).unwrap(); + let mut rank = MeritRank::new(Graph::new()).unwrap(); - rank.add_node(0, ()); - rank.add_node(1, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(0, 1, 1.0); - rank.add_node(2, ()); - rank.add_node(3, ()); - rank.add_node(4, ()); - rank.add_node(5, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(4, 5, 9.0); - rank.add_node(6, ()); - rank.add_node(7, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(6, 7, 7.0); - rank.add_node(8, ()); - rank.add_node(9, ()); - rank.add_node(10, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(9, 10, 3.0); - rank.add_node(11, ()); - rank.add_node(12, ()); - rank.add_node(13, ()); - rank.add_node(14, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(13, 14, -1.0); - rank.add_node(15, ()); - rank.add_node(16, ()); - rank.add_node(17, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(16, 17, -1.0); - rank.add_node(18, ()); - rank.add_node(19, ()); - rank.add_node(20, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(19, 20, 1.0); - rank.add_node(21, ()); - rank.add_node(22, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(21, 22, 1.0); - rank.add_node(23, ()); - rank.add_node(24, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(23, 24, 0.0); - rank.add_node(25, ()); + rank.get_new_nodeid(); rank.add_edge(9, 25, 1.0); - rank.add_node(26, ()); - rank.add_node(27, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(26, 27, 1.0); - rank.add_node(28, ()); - rank.add_node(29, ()); - rank.add_node(30, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(30, 22, 4.0); - rank.add_node(31, ()); - rank.add_node(32, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(31, 32, 1.0); - rank.add_node(33, ()); - rank.add_node(34, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(13, 34, -1.0); - rank.add_node(35, ()); + rank.get_new_nodeid(); rank.add_edge(9, 35, 1.0); - rank.add_node(36, ()); - rank.add_node(37, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(36, 37, 1.0); - rank.add_node(38, ()); - rank.add_node(39, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(38, 39, 1.0); - rank.add_node(40, ()); - rank.add_node(41, ()); - rank.add_node(42, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(42, 1, 6.0); rank.add_edge(35, 14, -1.0); - rank.add_node(43, ()); - rank.add_node(44, ()); - rank.add_node(45, ()); - rank.add_node(46, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(45, 46, -2.0); - rank.add_node(47, ()); - rank.add_node(48, ()); - rank.add_node(49, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(48, 49, -1.0); - rank.add_node(50, ()); - rank.add_node(51, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(50, 51, 5.0); rank.add_edge(24, 27, 1.0); rank.add_edge(31, 27, 1.0); - rank.add_node(52, ()); - rank.add_node(53, ()); - rank.add_node(54, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(53, 54, 1.0); - rank.add_node(55, ()); - rank.add_node(56, ()); - rank.add_node(57, ()); - rank.add_node(58, ()); - rank.add_node(59, ()); - rank.add_node(60, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(59, 60, 1.0); - rank.add_node(61, ()); - rank.add_node(62, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(61, 62, 1.0); - rank.add_node(63, ()); + rank.get_new_nodeid(); rank.add_edge(63, 24, -2.0); - rank.add_node(64, ()); + rank.get_new_nodeid(); rank.add_edge(64, 0, 1.0); - rank.add_node(65, ()); - rank.add_node(66, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(65, 66, 1.0); - rank.add_node(67, ()); - rank.add_node(68, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(68, 7, 2.0); - rank.add_node(69, ()); + rank.get_new_nodeid(); rank.add_edge(30, 49, 6.0); - rank.add_node(70, ()); + rank.get_new_nodeid(); rank.add_edge(70, 22, 3.0); - rank.add_node(71, ()); + rank.get_new_nodeid(); rank.add_edge(53, 71, 1.0); - rank.add_node(72, ()); + rank.get_new_nodeid(); rank.add_edge(72, 48, 1.0); - rank.add_node(73, ()); - rank.add_node(74, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(73, 74, 1.0); rank.add_edge(21, 6, -1.0); - rank.add_node(75, ()); - rank.add_node(76, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(75, 76, 1.0); rank.add_edge(70, 14, 1.0); - rank.add_node(77, ()); - rank.add_node(78, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(78, 24, 1.0); - rank.add_node(79, ()); - rank.add_node(80, ()); - rank.add_node(81, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(9, 81, -1.0); - rank.add_node(82, ()); - rank.add_node(83, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(82, 83, 1.0); - rank.add_node(84, ()); + rank.get_new_nodeid(); rank.add_edge(84, 51, 1.0); - rank.add_node(85, ()); - rank.add_node(86, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(85, 86, 1.0); - rank.add_node(87, ()); - rank.add_node(88, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(88, 48, 1.0); - rank.add_node(89, ()); - rank.add_node(90, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(89, 90, 1.0); - rank.add_node(91, ()); - rank.add_node(92, ()); - rank.add_node(93, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(92, 93, 1.0); - rank.add_node(94, ()); - rank.add_node(95, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(94, 95, -1.0); - rank.add_node(96, ()); + rank.get_new_nodeid(); rank.add_edge(93, 96, 1.0); - rank.add_node(97, ()); + rank.get_new_nodeid(); rank.add_edge(97, 88, 8.0); - rank.add_node(98, ()); + rank.get_new_nodeid(); rank.add_edge(13, 98, -1.0); rank.add_edge(31, 42, 1.0); - rank.add_node(99, ()); + rank.get_new_nodeid(); rank.add_edge(13, 51, -1.0); - rank.add_node(100, ()); + rank.get_new_nodeid(); rank.add_edge(9, 100, -1.0); rank.add_edge(68, 96, 1.0); - rank.add_node(101, ()); - rank.add_node(102, ()); - rank.add_node(103, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(102, 103, 1.0); - rank.add_node(104, ()); + rank.get_new_nodeid(); rank.add_edge(104, 76, 1.0); - rank.add_node(105, ()); - rank.add_node(106, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(105, 106, 1.0); - rank.add_node(107, ()); + rank.get_new_nodeid(); rank.add_edge(107, 72, 0.0); - rank.add_node(108, ()); + rank.get_new_nodeid(); rank.add_edge(108, 1, 14.0); - rank.add_node(109, ()); - rank.add_node(110, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(109, 110, 1.0); - rank.add_node(111, ()); + rank.get_new_nodeid(); rank.add_edge(50, 111, 6.0); - rank.add_node(112, ()); + rank.get_new_nodeid(); rank.add_edge(112, 76, 1.0); - rank.add_node(113, ()); + rank.get_new_nodeid(); rank.add_edge(113, 27, 1.0); - rank.add_node(114, ()); - rank.add_node(115, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(114, 115, 4.0); - rank.add_node(116, ()); + rank.get_new_nodeid(); rank.add_edge(110, 116, 1.0); rank.add_edge(9, 32, 1.0); - rank.add_node(117, ()); - rank.add_node(118, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(117, 118, 1.0); - rank.add_node(119, ()); - rank.add_node(120, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(119, 120, 1.0); - rank.add_node(121, ()); + rank.get_new_nodeid(); rank.add_edge(59, 121, 1.0); - rank.add_node(122, ()); - rank.add_node(123, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(123, 105, 1.0); - rank.add_node(124, ()); - rank.add_node(125, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(124, 125, 1.0); - rank.add_node(126, ()); + rank.get_new_nodeid(); rank.add_edge(27, 126, 1.0); - rank.add_node(127, ()); - rank.add_node(128, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(85, 128, 1.0); - rank.add_node(129, ()); + rank.get_new_nodeid(); rank.add_edge(104, 129, 1.0); rank.add_edge(27, 26, 1.0); - rank.add_node(130, ()); - rank.add_node(131, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(114, 131, 2.0); - rank.add_node(132, ()); + rank.get_new_nodeid(); rank.add_edge(132, 1, 1.0); - rank.add_node(133, ()); + rank.get_new_nodeid(); rank.add_edge(9, 125, 1.0); - rank.add_node(134, ()); + rank.get_new_nodeid(); rank.add_edge(82, 134, 1.0); - rank.add_node(135, ()); + rank.get_new_nodeid(); rank.add_edge(135, 56, 1.0); rank.add_edge(84, 88, 9.0); - rank.add_node(136, ()); - rank.add_node(137, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(21, 137, 1.0); - rank.add_node(138, ()); - rank.add_node(139, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(9, 139, 1.0); - rank.add_node(140, ()); - rank.add_node(141, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(140, 141, 1.0); - rank.add_node(142, ()); + rank.get_new_nodeid(); rank.add_edge(142, 25, 1.0); rank.add_edge(9, 98, -1.0); - rank.add_node(143, ()); - rank.add_node(144, ()); - rank.add_node(145, ()); - rank.add_node(146, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(145, 146, 8.0); - rank.add_node(147, ()); + rank.get_new_nodeid(); rank.add_edge(97, 147, 1.0); - rank.add_node(148, ()); - rank.add_node(149, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(148, 149, 1.0); rank.add_edge(9, 24, 3.0); - rank.add_node(150, ()); + rank.get_new_nodeid(); rank.add_edge(150, 46, 2.0); - rank.add_node(151, ()); - rank.add_node(152, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(151, 152, 1.0); - rank.add_node(153, ()); - rank.add_node(154, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(153, 154, 3.0); rank.add_edge(13, 46, 1.0); - rank.add_node(155, ()); + rank.get_new_nodeid(); rank.add_edge(155, 31, 1.0); rank.add_edge(69, 14, 2.0); rank.add_edge(4, 76, 1.0); - rank.add_node(156, ()); + rank.get_new_nodeid(); rank.add_edge(35, 156, -1.0); - rank.add_node(157, ()); + rank.get_new_nodeid(); rank.add_edge(31, 157, 1.0); - rank.add_node(158, ()); - rank.add_node(159, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(158, 159, 1.0); rank.add_edge(69, 129, 2.0); - rank.add_node(160, ()); - rank.add_node(161, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(27, 161, 1.0); - rank.add_node(162, ()); + rank.get_new_nodeid(); rank.add_edge(162, 76, -1.0); - rank.add_node(163, ()); + rank.get_new_nodeid(); rank.add_edge(19, 81, 1.0); - rank.add_node(164, ()); + rank.get_new_nodeid(); rank.add_edge(147, 97, 1.0); - rank.add_node(165, ()); + rank.get_new_nodeid(); rank.add_edge(124, 165, 1.0); rank.add_edge(161, 27, 1.0); - rank.add_node(166, ()); + rank.get_new_nodeid(); rank.add_edge(9, 54, 3.0); rank.add_edge(65, 24, 2.0); - rank.add_node(167, ()); - rank.add_node(168, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(107, 168, 1.0); - rank.add_node(169, ()); - rank.add_node(170, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(27, 170, 1.0); rank.add_edge(149, 24, 5.0); - rank.add_node(171, ()); + rank.get_new_nodeid(); rank.add_edge(70, 171, 1.0); rank.add_edge(110, 72, -1.0); - rank.add_node(172, ()); + rank.get_new_nodeid(); rank.add_edge(172, 69, 1.0); - rank.add_node(173, ()); + rank.get_new_nodeid(); rank.add_edge(113, 173, -11.0); rank.add_edge(104, 75, 4.0); rank.add_edge(125, 9, 1.0); - rank.add_node(174, ()); + rank.get_new_nodeid(); rank.add_edge(31, 174, 1.0); rank.add_edge(0, 10, 1.0); - rank.add_node(175, ()); + rank.get_new_nodeid(); rank.add_edge(13, 175, -1.0); - rank.add_node(176, ()); + rank.get_new_nodeid(); rank.add_edge(176, 35, 1.0); - rank.add_node(177, ()); - rank.add_node(178, ()); - rank.add_node(179, ()); - rank.add_node(180, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(180, 95, 3.0); rank.add_edge(69, 12, 1.0); rank.add_edge(13, 9, 1.0); rank.add_edge(146, 4, 1.0); - rank.add_node(181, ()); - rank.add_node(182, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(181, 182, 1.0); rank.add_edge(0, 24, 1.0); - rank.add_node(183, ()); - rank.add_node(184, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(183, 184, 1.0); - rank.add_node(185, ()); + rank.get_new_nodeid(); rank.add_edge(185, 13, 1.0); rank.add_edge(9, 46, 3.0); rank.add_edge(48, 162, 1.0); rank.add_edge(31, 13, 1.0); - rank.add_node(186, ()); - rank.add_node(187, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(186, 187, 1.0); - rank.add_node(188, ()); + rank.get_new_nodeid(); rank.add_edge(4, 14, 9.0); - rank.add_node(189, ()); - rank.add_node(190, ()); - rank.add_node(191, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(190, 191, -1.0); rank.add_edge(116, 110, 1.0); - rank.add_node(192, ()); + rank.get_new_nodeid(); rank.add_edge(192, 24, -1.0); rank.add_edge(47, 175, 3.0); - rank.add_node(193, ()); - rank.add_node(194, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(50, 194, 1.0); - rank.add_node(195, ()); + rank.get_new_nodeid(); rank.add_edge(31, 35, 1.0); rank.add_edge(145, 191, 3.0); rank.add_edge(31, 9, 1.0); rank.add_edge(31, 51, -1.0); rank.add_edge(19, 154, 6.0); - rank.add_node(196, ()); - rank.add_node(197, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(76, 114, -1.0); rank.add_edge(35, 81, -1.0); - rank.add_node(198, ()); - rank.add_node(199, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(48, 22, 5.0); - rank.add_node(200, ()); - rank.add_node(201, ()); - rank.add_node(202, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(4, 202, 4.0); rank.add_edge(31, 34, -1.0); - rank.add_node(203, ()); - rank.add_node(204, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(9, 204, -1.0); rank.add_edge(19, 49, 1.0); - rank.add_node(205, ()); + rank.get_new_nodeid(); rank.add_edge(205, 35, 1.0); - rank.add_node(206, ()); + rank.get_new_nodeid(); rank.add_edge(27, 206, 1.0); rank.add_edge(83, 13, 1.0); rank.add_edge(110, 13, 1.0); rank.add_edge(82, 46, 1.0); rank.add_edge(114, 168, -1.0); rank.add_edge(12, 173, 1.0); - rank.add_node(207, ()); - rank.add_node(208, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(9, 208, 3.0); - rank.add_node(209, ()); - rank.add_node(210, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(209, 210, 1.0); - rank.add_node(211, ()); - rank.add_node(212, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(113, 212, 1.0); - rank.add_node(213, ()); + rank.get_new_nodeid(); rank.add_edge(76, 213, 1.0); rank.add_edge(31, 185, 1.0); rank.add_edge(6, 70, 1.0); - rank.add_node(214, ()); - rank.add_node(215, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(215, 205, 5.0); - rank.add_node(216, ()); + rank.get_new_nodeid(); rank.add_edge(216, 31, 1.0); rank.add_edge(153, 114, 1.0); - rank.add_node(217, ()); + rank.get_new_nodeid(); rank.add_edge(183, 1, 3.0); - rank.add_node(218, ()); + rank.get_new_nodeid(); rank.add_edge(110, 175, -9.0); - rank.add_node(219, ()); + rank.get_new_nodeid(); rank.add_edge(132, 7, -1.0); - rank.add_node(220, ()); + rank.get_new_nodeid(); rank.add_edge(220, 151, 1.0); rank.add_edge(124, 205, 1.0); rank.add_edge(103, 102, 1.0); - rank.add_node(221, ()); + rank.get_new_nodeid(); rank.add_edge(215, 35, 1.0); rank.add_edge(108, 115, -4.0); - rank.add_node(222, ()); - rank.add_node(223, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(50, 223, 3.0); - rank.add_node(224, ()); - rank.add_node(225, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(225, 77, 1.0); - rank.add_node(226, ()); + rank.get_new_nodeid(); rank.add_edge(39, 75, 2.0); rank.add_edge(104, 153, -1.0); rank.add_edge(145, 75, -1.0); rank.add_edge(82, 165, 1.0); - rank.add_node(227, ()); + rank.get_new_nodeid(); rank.add_edge(35, 227, 1.0); - rank.add_node(228, ()); + rank.get_new_nodeid(); rank.add_edge(35, 228, 1.0); - rank.add_node(229, ()); - rank.add_node(230, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(229, 230, 1.0); - rank.add_node(231, ()); + rank.get_new_nodeid(); rank.add_edge(231, 150, 1.0); - rank.add_node(232, ()); + rank.get_new_nodeid(); rank.add_edge(113, 18, 1.0); - rank.add_node(233, ()); + rank.get_new_nodeid(); rank.add_edge(233, 9, 1.0); rank.add_edge(210, 24, -2.0); rank.add_edge(31, 191, -1.0); - rank.add_node(234, ()); + rank.get_new_nodeid(); rank.add_edge(9, 26, 2.0); - rank.add_node(235, ()); - rank.add_node(236, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(236, 107, 1.0); - rank.add_node(237, ()); + rank.get_new_nodeid(); rank.add_edge(31, 237, 1.0); rank.add_edge(98, 215, 1.0); - rank.add_node(238, ()); - rank.add_node(239, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(239, 46, 4.0); rank.add_edge(100, 19, 1.0); - rank.add_node(240, ()); + rank.get_new_nodeid(); rank.add_edge(6, 240, 1.0); rank.add_edge(108, 72, -8.0); rank.add_edge(9, 175, -1.0); - rank.add_node(241, ()); + rank.get_new_nodeid(); rank.add_edge(241, 39, 1.0); rank.add_edge(230, 1, -2.0); rank.add_edge(82, 237, 1.0); - rank.add_node(242, ()); + rank.get_new_nodeid(); rank.add_edge(242, 53, 1.0); - rank.add_node(243, ()); + rank.get_new_nodeid(); rank.add_edge(243, 186, 1.0); - rank.add_node(244, ()); + rank.get_new_nodeid(); rank.add_edge(114, 244, 2.0); - rank.add_node(245, ()); - rank.add_node(246, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(30, 246, 5.0); rank.add_edge(19, 244, 1.0); rank.add_edge(39, 49, 4.0); - rank.add_node(247, ()); + rank.get_new_nodeid(); rank.add_edge(247, 77, 1.0); rank.add_edge(20, 19, 1.0); rank.add_edge(4, 213, 8.0); rank.add_edge(30, 240, 3.0); - rank.add_node(248, ()); - rank.add_node(249, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(249, 12, 1.0); rank.add_edge(13, 83, 1.0); rank.add_edge(121, 59, 1.0); - rank.add_node(250, ()); + rank.get_new_nodeid(); rank.add_edge(250, 153, 1.0); rank.add_edge(13, 109, -1.0); rank.add_edge(150, 24, 4.0); @@ -481,288 +481,288 @@ mod tests { rank.add_edge(227, 35, 1.0); rank.add_edge(151, 7, 0.0); rank.add_edge(6, 111, 1.0); - rank.add_node(251, ()); + rank.get_new_nodeid(); rank.add_edge(9, 251, -1.0); - rank.add_node(252, ()); + rank.get_new_nodeid(); rank.add_edge(9, 252, 3.0); - rank.add_node(253, ()); + rank.get_new_nodeid(); rank.add_edge(4, 246, 4.0); - rank.add_node(254, ()); + rank.get_new_nodeid(); rank.add_edge(145, 254, 1.0); - rank.add_node(255, ()); - rank.add_node(256, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(255, 256, 1.0); rank.add_edge(18, 139, 1.0); rank.add_edge(21, 22, 5.0); - rank.add_node(257, ()); + rank.get_new_nodeid(); rank.add_edge(9, 257, 1.0); - rank.add_node(258, ()); + rank.get_new_nodeid(); rank.add_edge(27, 258, 1.0); rank.add_edge(150, 172, -5.0); rank.add_edge(159, 24, -1.0); - rank.add_node(259, ()); + rank.get_new_nodeid(); rank.add_edge(259, 24, -1.0); rank.add_edge(35, 1, -1.0); - rank.add_node(260, ()); + rank.get_new_nodeid(); rank.add_edge(31, 260, 1.0); - rank.add_node(261, ()); + rank.get_new_nodeid(); rank.add_edge(21, 261, 9.0); - rank.add_node(262, ()); - rank.add_node(263, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(263, 1, 1.0); - rank.add_node(264, ()); + rank.get_new_nodeid(); rank.add_edge(85, 264, 1.0); - rank.add_node(265, ()); - rank.add_node(266, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(266, 90, 1.0); - rank.add_node(267, ()); + rank.get_new_nodeid(); rank.add_edge(31, 165, 1.0); - rank.add_node(268, ()); + rank.get_new_nodeid(); rank.add_edge(93, 268, 1.0); rank.add_edge(48, 129, -1.0); - rank.add_node(269, ()); + rank.get_new_nodeid(); rank.add_edge(269, 93, 1.0); rank.add_edge(107, 236, 1.0); rank.add_edge(129, 104, 1.0); rank.add_edge(175, 39, 1.0); - rank.add_node(270, ()); + rank.get_new_nodeid(); rank.add_edge(270, 73, -7.0); rank.add_edge(63, 72, 2.0); rank.add_edge(32, 9, 1.0); rank.add_edge(104, 194, 5.0); - rank.add_node(271, ()); - rank.add_node(272, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(271, 272, 1.0); rank.add_edge(246, 76, 1.0); rank.add_edge(31, 155, 1.0); rank.add_edge(21, 20, 2.0); - rank.add_node(273, ()); + rank.get_new_nodeid(); rank.add_edge(31, 14, -1.0); - rank.add_node(274, ()); + rank.get_new_nodeid(); rank.add_edge(274, 84, 1.0); rank.add_edge(48, 72, 1.0); - rank.add_node(275, ()); + rank.get_new_nodeid(); rank.add_edge(13, 100, -1.0); - rank.add_node(276, ()); - rank.add_node(277, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(277, 44, 1.0); - rank.add_node(278, ()); + rank.get_new_nodeid(); rank.add_edge(69, 278, 4.0); - rank.add_node(279, ()); + rank.get_new_nodeid(); rank.add_edge(279, 45, 1.0); rank.add_edge(162, 75, 7.0); rank.add_edge(6, 69, 1.0); - rank.add_node(280, ()); + rank.get_new_nodeid(); rank.add_edge(255, 257, 1.0); - rank.add_node(281, ()); - rank.add_node(282, ()); - rank.add_node(283, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(82, 185, 1.0); - rank.add_node(284, ()); + rank.get_new_nodeid(); rank.add_edge(45, 279, 1.0); - rank.add_node(285, ()); - rank.add_node(286, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(27, 286, 1.0); - rank.add_node(287, ()); - rank.add_node(288, ()); - rank.add_node(289, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(289, 24, 1.0); - rank.add_node(290, ()); + rank.get_new_nodeid(); rank.add_edge(21, 290, 1.0); - rank.add_node(291, ()); - rank.add_node(292, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(27, 292, 1.0); rank.add_edge(115, 12, 1.0); - rank.add_node(293, ()); - rank.add_node(294, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(9, 294, 1.0); rank.add_edge(13, 204, -1.0); - rank.add_node(295, ()); - rank.add_node(296, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(13, 296, 1.0); - rank.add_node(297, ()); - rank.add_node(298, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(298, 110, 1.0); - rank.add_node(299, ()); + rank.get_new_nodeid(); rank.add_edge(35, 165, 1.0); rank.add_edge(113, 17, 3.0); rank.add_edge(151, 220, 1.0); - rank.add_node(300, ()); + rank.get_new_nodeid(); rank.add_edge(35, 191, -1.0); rank.add_edge(16, 24, 2.0); - rank.add_node(301, ()); + rank.get_new_nodeid(); rank.add_edge(301, 159, 1.0); rank.add_edge(124, 25, 1.0); - rank.add_node(302, ()); + rank.get_new_nodeid(); rank.add_edge(302, 159, 1.0); rank.add_edge(39, 72, 7.0); - rank.add_node(303, ()); + rank.get_new_nodeid(); rank.add_edge(84, 147, -1.0); rank.add_edge(9, 14, -1.0); - rank.add_node(304, ()); + rank.get_new_nodeid(); rank.add_edge(304, 257, 1.0); rank.add_edge(50, 173, 9.0); rank.add_edge(141, 24, 2.0); rank.add_edge(35, 205, 1.0); - rank.add_node(305, ()); + rank.get_new_nodeid(); rank.add_edge(163, 305, 1.0); rank.add_edge(244, 19, 1.0); - rank.add_node(306, ()); - rank.add_node(307, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(306, 307, 1.0); rank.add_edge(290, 21, 1.0); rank.add_edge(27, 252, 1.0); - rank.add_node(308, ()); + rank.get_new_nodeid(); rank.add_edge(27, 308, 1.0); rank.add_edge(25, 142, 1.0); - rank.add_node(309, ()); + rank.get_new_nodeid(); rank.add_edge(53, 309, -18.0); - rank.add_node(310, ()); + rank.get_new_nodeid(); rank.add_edge(280, 310, 1.0); - rank.add_node(311, ()); + rank.get_new_nodeid(); rank.add_edge(311, 27, 1.0); rank.add_edge(62, 61, 1.0); rank.add_edge(30, 7, 2.0); - rank.add_node(312, ()); + rank.get_new_nodeid(); rank.add_edge(104, 154, 5.0); - rank.add_node(313, ()); - rank.add_node(314, ()); - rank.add_node(315, ()); - rank.add_node(316, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(79, 316, 1.0); - rank.add_node(317, ()); + rank.get_new_nodeid(); rank.add_edge(110, 317, 5.0); rank.add_edge(141, 140, 1.0); rank.add_edge(35, 24, 4.0); rank.add_edge(76, 246, 1.0); - rank.add_node(318, ()); + rank.get_new_nodeid(); rank.add_edge(296, 13, 1.0); rank.add_edge(18, 46, 7.0); - rank.add_node(319, ()); + rank.get_new_nodeid(); rank.add_edge(6, 131, 4.0); - rank.add_node(320, ()); + rank.get_new_nodeid(); rank.add_edge(9, 320, -1.0); - rank.add_node(321, ()); + rank.get_new_nodeid(); rank.add_edge(260, 53, 1.0); rank.add_edge(47, 14, -1.0); rank.add_edge(305, 163, 1.0); rank.add_edge(82, 205, 1.0); rank.add_edge(163, 72, 0.0); - rank.add_node(322, ()); + rank.get_new_nodeid(); rank.add_edge(322, 27, 1.0); - rank.add_node(323, ()); + rank.get_new_nodeid(); rank.add_edge(110, 109, 1.0); - rank.add_node(324, ()); + rank.get_new_nodeid(); rank.add_edge(0, 324, 1.0); rank.add_edge(35, 72, -1.0); rank.add_edge(71, 53, 1.0); - rank.add_node(325, ()); + rank.get_new_nodeid(); rank.add_edge(183, 241, -3.0); rank.add_edge(208, 27, 1.0); rank.add_edge(204, 97, 1.0); rank.add_edge(81, 19, 1.0); - rank.add_node(326, ()); + rank.get_new_nodeid(); rank.add_edge(4, 326, 6.0); - rank.add_node(327, ()); + rank.get_new_nodeid(); rank.add_edge(9, 156, -1.0); - rank.add_node(328, ()); + rank.get_new_nodeid(); rank.add_edge(9, 328, 1.0); - rank.add_node(329, ()); + rank.get_new_nodeid(); rank.add_edge(329, 275, 1.0); rank.add_edge(120, 237, 1.0); - rank.add_node(330, ()); + rank.get_new_nodeid(); rank.add_edge(275, 24, -4.0); rank.add_edge(221, 27, 1.0); - rank.add_node(331, ()); + rank.get_new_nodeid(); rank.add_edge(9, 331, 1.0); - rank.add_node(332, ()); + rank.get_new_nodeid(); rank.add_edge(12, 249, 1.0); - rank.add_node(333, ()); + rank.get_new_nodeid(); rank.add_edge(113, 156, -3.0); - rank.add_node(334, ()); + rank.get_new_nodeid(); rank.add_edge(0, 64, 1.0); rank.add_edge(110, 185, 3.0); - rank.add_node(335, ()); + rank.get_new_nodeid(); rank.add_edge(70, 7, 3.0); rank.add_edge(39, 38, 1.0); rank.add_edge(13, 81, -1.0); - rank.add_node(336, ()); - rank.add_node(337, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(336, 337, 1.0); rank.add_edge(21, 1, 1.0); rank.add_edge(190, 24, 2.0); - rank.add_node(338, ()); + rank.get_new_nodeid(); rank.add_edge(338, 221, 1.0); rank.add_edge(31, 172, -1.0); - rank.add_node(339, ()); + rank.get_new_nodeid(); rank.add_edge(27, 339, 1.0); rank.add_edge(294, 9, 1.0); - rank.add_node(340, ()); + rank.get_new_nodeid(); rank.add_edge(340, 97, 1.0); rank.add_edge(213, 76, 1.0); rank.add_edge(49, 19, 1.0); rank.add_edge(69, 326, 1.0); rank.add_edge(82, 64, 1.0); - rank.add_node(341, ()); + rank.get_new_nodeid(); rank.add_edge(27, 341, 1.0); rank.add_edge(48, 131, 1.0); - rank.add_node(342, ()); + rank.get_new_nodeid(); rank.add_edge(13, 249, -1.0); - rank.add_node(343, ()); + rank.get_new_nodeid(); rank.add_edge(114, 88, 7.0); rank.add_edge(31, 72, -1.0); - rank.add_node(344, ()); - rank.add_node(345, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(345, 230, 1.0); rank.add_edge(18, 7, -5.0); rank.add_edge(110, 32, 3.0); - rank.add_node(346, ()); + rank.get_new_nodeid(); rank.add_edge(48, 70, 1.0); - rank.add_node(347, ()); + rank.get_new_nodeid(); rank.add_edge(347, 27, 1.0); - rank.add_node(348, ()); + rank.get_new_nodeid(); rank.add_edge(134, 42, 1.0); rank.add_edge(215, 98, 1.0); - rank.add_node(349, ()); + rank.get_new_nodeid(); rank.add_edge(255, 304, 4.0); rank.add_edge(76, 47, -1.0); rank.add_edge(35, 6, 1.0); - rank.add_node(350, ()); - rank.add_node(351, ()); - rank.add_node(352, ()); - rank.add_node(353, ()); - rank.add_node(354, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(101, 354, 1.0); - rank.add_node(355, ()); + rank.get_new_nodeid(); rank.add_edge(30, 47, 1.0); rank.add_edge(12, 261, -1.0); rank.add_edge(70, 223, 5.0); rank.add_edge(31, 119, 1.0); rank.add_edge(264, 85, 1.0); rank.add_edge(230, 241, 1.0); - rank.add_node(356, ()); - rank.add_node(357, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(357, 44, 1.0); rank.add_edge(240, 48, 1.0); - rank.add_node(358, ()); + rank.get_new_nodeid(); rank.add_edge(12, 22, -1.0); - rank.add_node(359, ()); + rank.get_new_nodeid(); rank.add_edge(359, 31, 1.0); rank.add_edge(95, 284, 1.0); rank.add_edge(239, 172, 2.0); - rank.add_node(360, ()); + rank.get_new_nodeid(); rank.add_edge(149, 32, 5.0); rank.add_edge(86, 85, 1.0); rank.add_edge(31, 216, 1.0); rank.add_edge(21, 191, 1.0); rank.add_edge(272, 271, 1.0); - rank.add_node(361, ()); + rank.get_new_nodeid(); rank.add_edge(361, 93, 1.0); - rank.add_node(362, ()); + rank.get_new_nodeid(); rank.add_edge(0, 157, 1.0); rank.add_edge(35, 204, -1.0); rank.add_edge(69, 172, 1.0); - rank.add_node(363, ()); + rank.get_new_nodeid(); rank.add_edge(363, 259, 1.0); rank.add_edge(257, 304, 1.0); rank.add_edge(9, 213, 1.0); @@ -770,66 +770,66 @@ mod tests { rank.add_edge(104, 69, 1.0); rank.add_edge(181, 24, 2.0); rank.add_edge(113, 46, 1.0); - rank.add_node(364, ()); + rank.get_new_nodeid(); rank.add_edge(364, 35, 1.0); rank.add_edge(31, 64, 1.0); - rank.add_node(365, ()); + rank.get_new_nodeid(); rank.add_edge(162, 30, 1.0); - rank.add_node(366, ()); + rank.get_new_nodeid(); rank.add_edge(9, 228, 1.0); rank.add_edge(62, 24, 2.0); rank.add_edge(110, 24, 9.0); - rank.add_node(367, ()); + rank.get_new_nodeid(); rank.add_edge(68, 46, 5.0); rank.add_edge(37, 36, 1.0); - rank.add_node(368, ()); - rank.add_node(369, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(97, 369, 9.0); - rank.add_node(370, ()); + rank.get_new_nodeid(); rank.add_edge(60, 59, 1.0); rank.add_edge(113, 191, -3.0); rank.add_edge(50, 278, 1.0); - rank.add_node(371, ()); + rank.get_new_nodeid(); rank.add_edge(107, 24, -1.0); rank.add_edge(145, 70, -1.0); rank.add_edge(35, 252, 4.0); rank.add_edge(48, 5, 1.0); - rank.add_node(372, ()); + rank.get_new_nodeid(); rank.add_edge(372, 18, 1.0); rank.add_edge(76, 38, 2.0); rank.add_edge(259, 168, -1.0); - rank.add_node(373, ()); + rank.get_new_nodeid(); rank.add_edge(373, 9, 1.0); - rank.add_node(374, ()); + rank.get_new_nodeid(); rank.add_edge(50, 374, -1.0); rank.add_edge(110, 83, 2.0); - rank.add_node(375, ()); - rank.add_node(376, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(153, 376, 1.0); - rank.add_node(377, ()); + rank.get_new_nodeid(); rank.add_edge(124, 377, 1.0); rank.add_edge(239, 187, 3.0); rank.add_edge(9, 260, 3.0); - rank.add_node(378, ()); + rank.get_new_nodeid(); rank.add_edge(12, 21, 1.0); rank.add_edge(118, 117, 1.0); - rank.add_node(379, ()); + rank.get_new_nodeid(); rank.add_edge(261, 153, 1.0); rank.add_edge(21, 202, 6.0); - rank.add_node(380, ()); - rank.add_node(381, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(174, 120, 1.0); rank.add_edge(93, 46, 3.0); - rank.add_node(382, ()); - rank.add_node(383, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(114, 383, 1.0); rank.add_edge(149, 317, 1.0); rank.add_edge(194, 50, 1.0); - rank.add_node(384, ()); - rank.add_node(385, ()); - rank.add_node(386, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(286, 27, 1.0); - rank.add_node(387, ()); + rank.get_new_nodeid(); rank.add_edge(107, 387, 1.0); rank.add_edge(6, 4, 1.0); rank.add_edge(237, 120, 1.0); @@ -837,63 +837,63 @@ mod tests { rank.add_edge(376, 153, 1.0); rank.add_edge(47, 173, 1.0); rank.add_edge(13, 320, -1.0); - rank.add_node(388, ()); - rank.add_node(389, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(389, 59, 1.0); rank.add_edge(97, 204, 1.0); - rank.add_node(390, ()); + rank.get_new_nodeid(); rank.add_edge(13, 172, -1.0); - rank.add_node(391, ()); + rank.get_new_nodeid(); rank.add_edge(391, 62, 1.0); rank.add_edge(21, 72, 5.0); rank.add_edge(9, 6, 1.0); rank.add_edge(50, 223, 1.0); rank.add_edge(97, 115, -1.0); - rank.add_node(392, ()); + rank.get_new_nodeid(); rank.add_edge(9, 84, 1.0); - rank.add_node(393, ()); + rank.get_new_nodeid(); rank.add_edge(13, 103, -1.0); rank.add_edge(14, 70, 1.0); - rank.add_node(394, ()); + rank.get_new_nodeid(); rank.add_edge(4, 394, 8.0); rank.add_edge(9, 237, 3.0); rank.add_edge(257, 24, -4.0); - rank.add_node(395, ()); + rank.get_new_nodeid(); rank.add_edge(53, 395, 1.0); rank.add_edge(63, 241, 1.0); rank.add_edge(13, 0, 1.0); rank.add_edge(44, 357, 1.0); - rank.add_node(396, ()); + rank.get_new_nodeid(); rank.add_edge(396, 336, 1.0); rank.add_edge(184, 183, 1.0); rank.add_edge(31, 134, 3.0); rank.add_edge(108, 51, 3.0); rank.add_edge(113, 139, 3.0); - rank.add_node(397, ()); + rank.get_new_nodeid(); rank.add_edge(154, 97, 1.0); - rank.add_node(398, ()); + rank.get_new_nodeid(); rank.add_edge(270, 398, 1.0); rank.add_edge(13, 191, -1.0); - rank.add_node(399, ()); + rank.get_new_nodeid(); rank.add_edge(399, 65, 1.0); rank.add_edge(50, 131, 9.0); rank.add_edge(104, 112, 3.0); rank.add_edge(13, 383, -1.0); - rank.add_node(400, ()); - rank.add_node(401, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(401, 53, 1.0); rank.add_edge(31, 175, -1.0); rank.add_edge(113, 208, -1.0); rank.add_edge(53, 242, 1.0); rank.add_edge(128, 85, 1.0); - rank.add_node(402, ()); + rank.get_new_nodeid(); rank.add_edge(104, 47, -1.0); - rank.add_node(403, ()); + rank.get_new_nodeid(); rank.add_edge(110, 298, 1.0); rank.add_edge(97, 340, 3.0); - rank.add_node(404, ()); + rank.get_new_nodeid(); rank.add_edge(9, 142, 1.0); - rank.add_node(405, ()); + rank.get_new_nodeid(); rank.add_edge(336, 405, 1.0); rank.add_edge(94, 398, 1.0); rank.add_edge(124, 35, 0.0); @@ -902,42 +902,42 @@ mod tests { rank.add_edge(56, 135, 1.0); rank.add_edge(76, 112, 1.0); rank.add_edge(42, 175, 5.0); - rank.add_node(406, ()); - rank.add_node(407, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(13, 165, 1.0); rank.add_edge(9, 103, -1.0); - rank.add_node(408, ()); + rank.get_new_nodeid(); rank.add_edge(93, 408, 1.0); - rank.add_node(409, ()); + rank.get_new_nodeid(); rank.add_edge(409, 59, 1.0); - rank.add_node(410, ()); + rank.get_new_nodeid(); rank.add_edge(206, 27, 1.0); rank.add_edge(70, 250, -1.0); rank.add_edge(35, 161, 2.0); rank.add_edge(31, 83, 1.0); - rank.add_node(411, ()); + rank.get_new_nodeid(); rank.add_edge(21, 394, 1.0); rank.add_edge(150, 231, 1.0); - rank.add_node(412, ()); - rank.add_node(413, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(21, 51, 1.0); rank.add_edge(50, 246, 3.0); rank.add_edge(239, 139, 1.0); - rank.add_node(414, ()); + rank.get_new_nodeid(); rank.add_edge(27, 24, 1.0); rank.add_edge(21, 191, 9.0); rank.add_edge(107, 175, -1.0); - rank.add_node(415, ()); + rank.get_new_nodeid(); rank.add_edge(31, 251, -1.0); rank.add_edge(48, 240, 1.0); rank.add_edge(39, 112, 8.0); - rank.add_node(416, ()); + rank.get_new_nodeid(); rank.add_edge(66, 65, 1.0); - rank.add_node(417, ()); + rank.get_new_nodeid(); rank.add_edge(13, 115, -1.0); rank.add_edge(27, 35, 1.0); rank.add_edge(42, 72, 4.0); - rank.add_node(418, ()); + rank.get_new_nodeid(); rank.add_edge(307, 306, 1.0); rank.add_edge(35, 173, -1.0); rank.add_edge(4, 191, 6.0); @@ -945,49 +945,49 @@ mod tests { rank.add_edge(145, 168, 1.0); rank.add_edge(110, 115, -1.0); rank.add_edge(4, 145, 1.0); - rank.add_node(419, ()); + rank.get_new_nodeid(); rank.add_edge(104, 50, 1.0); rank.add_edge(31, 54, 1.0); rank.add_edge(44, 277, 1.0); - rank.add_node(420, ()); - rank.add_node(421, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(272, 252, 3.0); rank.add_edge(70, 5, 2.0); rank.add_edge(35, 308, 1.0); rank.add_edge(343, 24, 0.0); rank.add_edge(328, 9, 1.0); - rank.add_node(422, ()); + rank.get_new_nodeid(); rank.add_edge(0, 46, 1.0); rank.add_edge(104, 374, 5.0); rank.add_edge(90, 24, 0.0); rank.add_edge(59, 389, 1.0); - rank.add_node(423, ()); + rank.get_new_nodeid(); rank.add_edge(212, 113, 1.0); rank.add_edge(13, 173, -1.0); - rank.add_node(424, ()); + rank.get_new_nodeid(); rank.add_edge(30, 331, 1.0); rank.add_edge(27, 309, 1.0); - rank.add_node(425, ()); + rank.get_new_nodeid(); rank.add_edge(30, 75, 3.0); rank.add_edge(97, 1, 7.0); rank.add_edge(84, 7, 1.0); - rank.add_node(426, ()); - rank.add_node(427, ()); - rank.add_node(428, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(27, 428, 1.0); rank.add_edge(1, 21, 1.0); rank.add_edge(76, 75, 1.0); rank.add_edge(309, 27, 1.0); - rank.add_node(429, ()); + rank.get_new_nodeid(); rank.add_edge(31, 115, -1.0); rank.add_edge(18, 372, 1.0); rank.add_edge(394, 21, 1.0); rank.add_edge(259, 363, 1.0); rank.add_edge(221, 338, 1.0); - rank.add_node(430, ()); + rank.get_new_nodeid(); rank.add_edge(35, 341, 1.0); rank.add_edge(162, 14, 2.0); - rank.add_node(431, ()); + rank.get_new_nodeid(); rank.add_edge(70, 48, 1.0); rank.add_edge(97, 154, 1.0); rank.add_edge(21, 340, 9.0); @@ -1002,37 +1002,37 @@ mod tests { rank.add_edge(316, 79, 1.0); rank.add_edge(162, 115, 3.0); rank.add_edge(162, 278, 1.0); - rank.add_node(432, ()); + rank.get_new_nodeid(); rank.add_edge(30, 432, 1.0); rank.add_edge(84, 274, 1.0); - rank.add_node(433, ()); + rank.get_new_nodeid(); rank.add_edge(47, 6, 1.0); rank.add_edge(68, 24, 3.0); rank.add_edge(191, 21, 1.0); rank.add_edge(105, 24, 0.0); - rank.add_node(434, ()); + rank.get_new_nodeid(); rank.add_edge(4, 202, 1.0); rank.add_edge(19, 111, -1.0); rank.add_edge(31, 113, 1.0); - rank.add_node(435, ()); + rank.get_new_nodeid(); rank.add_edge(230, 229, 1.0); rank.add_edge(341, 27, 1.0); rank.add_edge(42, 134, 1.0); rank.add_edge(258, 27, 1.0); - rank.add_node(436, ()); + rank.get_new_nodeid(); rank.add_edge(221, 436, 1.0); rank.add_edge(93, 361, 1.0); rank.add_edge(9, 174, 3.0); rank.add_edge(62, 391, 1.0); rank.add_edge(19, 278, 4.0); rank.add_edge(35, 7, -1.0); - rank.add_node(437, ()); + rank.get_new_nodeid(); rank.add_edge(45, 437, 1.0); - rank.add_node(438, ()); + rank.get_new_nodeid(); rank.add_edge(438, 289, 1.0); - rank.add_node(439, ()); + rank.get_new_nodeid(); rank.add_edge(54, 53, 1.0); - rank.add_node(440, ()); + rank.get_new_nodeid(); rank.add_edge(107, 1, 1.0); rank.add_edge(39, 241, 1.0); rank.add_edge(374, 145, 1.0); @@ -1043,11 +1043,11 @@ mod tests { rank.add_edge(149, 46, 5.0); rank.add_edge(31, 304, 1.0); rank.add_edge(120, 119, 1.0); - rank.add_node(441, ()); + rank.get_new_nodeid(); rank.add_edge(31, 359, 1.0); - rank.add_node(442, ()); - rank.add_node(443, ()); - rank.add_node(444, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(30, 21, 1.0); rank.add_edge(145, 374, 1.0); rank.add_edge(13, 185, 1.0); @@ -1055,16 +1055,16 @@ mod tests { rank.add_edge(310, 280, 1.0); rank.add_edge(339, 27, 1.0); rank.add_edge(4, 154, 4.0); - rank.add_node(445, ()); + rank.get_new_nodeid(); rank.add_edge(48, 445, 1.0); rank.add_edge(408, 93, 1.0); - rank.add_node(446, ()); - rank.add_node(447, ()); - rank.add_node(448, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(111, 6, 1.0); rank.add_edge(48, 326, 4.0); rank.add_edge(239, 176, 3.0); - rank.add_node(449, ()); + rank.get_new_nodeid(); rank.add_edge(35, 449, 1.0); rank.add_edge(331, 30, 1.0); rank.add_edge(13, 156, -1.0); @@ -1073,103 +1073,103 @@ mod tests { rank.add_edge(110, 252, 5.0); rank.add_edge(13, 24, 2.0); rank.add_edge(63, 1, 1.0); - rank.add_node(450, ()); + rank.get_new_nodeid(); rank.add_edge(450, 90, 1.0); - rank.add_node(451, ()); + rank.get_new_nodeid(); rank.add_edge(360, 42, 1.0); rank.add_edge(59, 24, 1.0); rank.add_edge(13, 208, 2.0); rank.add_edge(82, 32, 1.0); - rank.add_node(452, ()); + rank.get_new_nodeid(); rank.add_edge(105, 452, 1.0); rank.add_edge(163, 251, 1.0); rank.add_edge(428, 27, 1.0); - rank.add_node(453, ()); + rank.get_new_nodeid(); rank.add_edge(275, 453, 1.0); rank.add_edge(278, 162, 1.0); rank.add_edge(9, 1, -1.0); - rank.add_node(454, ()); - rank.add_node(455, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(455, 280, 1.0); rank.add_edge(35, 339, 1.0); rank.add_edge(432, 30, 1.0); rank.add_edge(288, 24, 1.0); rank.add_edge(252, 27, 1.0); - rank.add_node(456, ()); + rank.get_new_nodeid(); rank.add_edge(456, 46, 4.0); - rank.add_node(457, ()); + rank.get_new_nodeid(); rank.add_edge(153, 261, 1.0); rank.add_edge(255, 46, 2.0); - rank.add_node(458, ()); + rank.get_new_nodeid(); rank.add_edge(141, 458, 1.0); rank.add_edge(35, 176, 1.0); rank.add_edge(162, 261, 8.0); rank.add_edge(31, 139, 1.0); rank.add_edge(9, 113, 1.0); - rank.add_node(459, ()); - rank.add_node(460, ()); - rank.add_node(461, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(306, 461, 1.0); rank.add_edge(63, 168, 0.0); - rank.add_node(462, ()); + rank.get_new_nodeid(); rank.add_edge(186, 462, 1.0); rank.add_edge(308, 27, 1.0); - rank.add_node(463, ()); + rank.get_new_nodeid(); rank.add_edge(47, 20, 3.0); rank.add_edge(76, 137, 8.0); - rank.add_node(464, ()); + rank.get_new_nodeid(); rank.add_edge(153, 115, 2.0); rank.add_edge(31, 173, -1.0); rank.add_edge(9, 246, 1.0); rank.add_edge(31, 0, 1.0); rank.add_edge(142, 205, 1.0); - rank.add_node(465, ()); + rank.get_new_nodeid(); rank.add_edge(9, 115, -1.0); rank.add_edge(13, 35, 1.0); rank.add_edge(84, 331, 3.0); rank.add_edge(13, 231, -1.0); - rank.add_node(466, ()); + rank.get_new_nodeid(); rank.add_edge(452, 105, 1.0); - rank.add_node(467, ()); + rank.get_new_nodeid(); rank.add_edge(356, 7, -3.0); - rank.add_node(468, ()); + rank.get_new_nodeid(); rank.add_edge(69, 468, 1.0); rank.add_edge(82, 208, 1.0); rank.add_edge(42, 24, -6.0); - rank.add_node(469, ()); + rank.get_new_nodeid(); rank.add_edge(159, 158, 1.0); rank.add_edge(19, 250, 4.0); rank.add_edge(6, 84, 1.0); - rank.add_node(470, ()); + rank.get_new_nodeid(); rank.add_edge(470, 93, 1.0); rank.add_edge(35, 172, -1.0); rank.add_edge(9, 205, 4.0); - rank.add_node(471, ()); + rank.get_new_nodeid(); rank.add_edge(27, 208, 1.0); rank.add_edge(102, 9, 1.0); rank.add_edge(239, 34, 2.0); - rank.add_node(472, ()); + rank.get_new_nodeid(); rank.add_edge(102, 32, 4.0); rank.add_edge(31, 24, 1.0); rank.add_edge(284, 95, 1.0); rank.add_edge(9, 286, 1.0); rank.add_edge(320, 68, 1.0); rank.add_edge(77, 225, 1.0); - rank.add_node(473, ()); + rank.get_new_nodeid(); rank.add_edge(19, 1, 8.0); rank.add_edge(275, 329, 1.0); rank.add_edge(39, 175, 1.0); - rank.add_node(474, ()); + rank.get_new_nodeid(); rank.add_edge(474, 24, 6.0); rank.add_edge(398, 270, 1.0); - rank.add_node(475, ()); - rank.add_node(476, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(27, 347, 1.0); - rank.add_node(477, ()); + rank.get_new_nodeid(); rank.add_edge(387, 107, 1.0); rank.add_edge(395, 53, 1.0); - rank.add_node(478, ()); - rank.add_node(479, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(6, 35, 1.0); rank.add_edge(13, 251, -1.0); rank.add_edge(165, 35, 1.0); @@ -1179,51 +1179,51 @@ mod tests { rank.add_edge(461, 306, 1.0); rank.add_edge(35, 208, 3.0); rank.add_edge(21, 369, 1.0); - rank.add_node(480, ()); + rank.get_new_nodeid(); rank.add_edge(59, 409, 1.0); rank.add_edge(21, 35, 1.0); rank.add_edge(65, 399, 1.0); - rank.add_node(481, ()); + rank.get_new_nodeid(); rank.add_edge(257, 46, 4.0); rank.add_edge(256, 255, 1.0); rank.add_edge(458, 141, 1.0); rank.add_edge(239, 24, 2.0); rank.add_edge(354, 101, 1.0); rank.add_edge(436, 221, 1.0); - rank.add_node(482, ()); + rank.get_new_nodeid(); rank.add_edge(113, 34, 5.0); rank.add_edge(9, 51, -1.0); rank.add_edge(35, 286, 2.0); - rank.add_node(483, ()); + rank.get_new_nodeid(); rank.add_edge(405, 336, 1.0); rank.add_edge(90, 450, 1.0); - rank.add_node(484, ()); - rank.add_node(485, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(97, 35, 1.0); rank.add_edge(19, 100, 1.0); - rank.add_node(486, ()); + rank.get_new_nodeid(); rank.add_edge(27, 486, 1.0); rank.add_edge(153, 250, 1.0); rank.add_edge(35, 51, -1.0); - rank.add_node(487, ()); - rank.add_node(488, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(7, 84, 1.0); rank.add_edge(9, 304, 3.0); rank.add_edge(48, 88, 1.0); rank.add_edge(163, 241, -1.0); - rank.add_node(489, ()); + rank.get_new_nodeid(); rank.add_edge(9, 373, 1.0); rank.add_edge(202, 4, 1.0); rank.add_edge(50, 369, 7.0); rank.add_edge(153, 1, 9.0); - rank.add_node(490, ()); - rank.add_node(491, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(9, 72, -1.0); - rank.add_node(492, ()); - rank.add_node(493, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(108, 7, -4.0); rank.add_edge(48, 376, 5.0); - rank.add_node(494, ()); + rank.get_new_nodeid(); rank.add_edge(145, 21, 1.0); rank.add_edge(168, 145, 1.0); rank.add_edge(4, 75, -1.0); @@ -1242,22 +1242,22 @@ mod tests { rank.add_edge(31, 10, 1.0); rank.add_edge(453, 275, 1.0); rank.add_edge(96, 93, 1.0); - rank.add_node(495, ()); - rank.add_node(496, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(85, 24, 0.0); rank.add_edge(228, 205, 1.0); rank.add_edge(93, 92, 1.0); - rank.add_node(497, ()); - rank.add_node(498, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(186, 243, 1.0); rank.add_edge(53, 260, 1.0); rank.add_edge(152, 151, 1.0); rank.add_edge(9, 249, -1.0); - rank.add_node(499, ()); - rank.add_node(500, ()); - rank.add_node(501, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(501, 151, 1.0); - rank.add_node(502, ()); + rank.get_new_nodeid(); rank.add_edge(445, 48, 1.0); rank.add_edge(9, 119, 3.0); rank.add_edge(97, 147, 4.0); @@ -1265,31 +1265,31 @@ mod tests { rank.add_edge(90, 266, 1.0); rank.add_edge(31, 205, 1.0); rank.add_edge(69, 48, 1.0); - rank.add_node(503, ()); + rank.get_new_nodeid(); rank.add_edge(151, 503, 1.0); rank.add_edge(4, 374, 2.0); rank.add_edge(84, 194, 6.0); rank.add_edge(4, 223, 1.0); - rank.add_node(504, ()); + rank.get_new_nodeid(); rank.add_edge(449, 35, 1.0); rank.add_edge(221, 24, 1.0); rank.add_edge(69, 171, 8.0); rank.add_edge(149, 208, 2.0); - rank.add_node(505, ()); + rank.get_new_nodeid(); rank.add_edge(35, 364, 1.0); rank.add_edge(30, 137, 5.0); - rank.add_node(506, ()); + rank.get_new_nodeid(); rank.add_edge(162, 84, 1.0); - rank.add_node(507, ()); + rank.get_new_nodeid(); rank.add_edge(77, 247, 1.0); rank.add_edge(13, 32, 1.0); rank.add_edge(35, 258, 1.0); - rank.add_node(508, ()); + rank.get_new_nodeid(); rank.add_edge(437, 45, 1.0); rank.add_edge(462, 186, 1.0); - rank.add_node(509, ()); + rank.get_new_nodeid(); rank.add_edge(133, 24, -3.0); - rank.add_node(510, ()); + rank.get_new_nodeid(); rank.add_edge(124, 27, 1.0); rank.add_edge(383, 114, 1.0); rank.add_edge(126, 27, 1.0); @@ -1297,33 +1297,33 @@ mod tests { rank.add_edge(42, 113, 1.0); rank.add_edge(151, 501, 1.0); rank.add_edge(270, 95, 7.0); - rank.add_node(511, ()); + rank.get_new_nodeid(); rank.add_edge(77, 511, 1.0); - rank.add_node(512, ()); + rank.get_new_nodeid(); rank.add_edge(27, 322, 1.0); - rank.add_node(513, ()); + rank.get_new_nodeid(); rank.add_edge(106, 105, 1.0); rank.add_edge(12, 115, 1.0); rank.add_edge(317, 149, 1.0); - rank.add_node(514, ()); + rank.get_new_nodeid(); rank.add_edge(31, 228, 1.0); - rank.add_node(515, ()); - rank.add_node(516, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(254, 145, 1.0); rank.add_edge(153, 147, 1.0); rank.add_edge(162, 147, 5.0); rank.add_edge(153, 20, -1.0); - rank.add_node(517, ()); + rank.get_new_nodeid(); rank.add_edge(183, 72, -1.0); rank.add_edge(44, 208, 0.0); - rank.add_node(518, ()); + rank.get_new_nodeid(); rank.add_edge(474, 1, -9.0); rank.add_edge(48, 104, 1.0); rank.add_edge(230, 345, 1.0); rank.add_edge(149, 148, 1.0); rank.add_edge(59, 17, -1.0); rank.add_edge(105, 123, 1.0); - rank.add_node(519, ()); + rank.get_new_nodeid(); rank.add_edge(10, 519, 1.0); rank.add_edge(34, 47, 1.0); rank.add_edge(223, 50, 1.0); @@ -1333,10 +1333,10 @@ mod tests { rank.add_edge(137, 21, 1.0); rank.add_edge(23, 1, 0.0); rank.add_edge(31, 46, 1.0); - rank.add_node(520, ()); - rank.add_node(521, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(219, 1, 1.0); - rank.add_node(522, ()); + rank.get_new_nodeid(); rank.add_edge(22, 21, 1.0); rank.add_edge(51, 84, 1.0); rank.add_edge(113, 324, 1.0); @@ -1345,8 +1345,8 @@ mod tests { rank.add_edge(468, 69, 1.0); rank.add_edge(47, 34, 1.0); rank.add_edge(163, 1, -2.0); - rank.add_node(523, ()); - rank.add_node(524, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(90, 89, 1.0); rank.add_edge(153, 5, 8.0); rank.add_edge(9, 172, -1.0); @@ -1354,49 +1354,49 @@ mod tests { rank.add_edge(9, 233, 1.0); rank.add_edge(511, 77, 1.0); rank.add_edge(84, 30, 1.0); - rank.add_node(525, ()); + rank.get_new_nodeid(); rank.add_edge(170, 27, 1.0); - rank.add_node(526, ()); + rank.get_new_nodeid(); rank.add_edge(173, 12, 1.0); rank.add_edge(30, 204, 5.0); - rank.add_node(527, ()); + rank.get_new_nodeid(); rank.add_edge(42, 7, 2.0); - rank.add_node(528, ()); + rank.get_new_nodeid(); rank.add_edge(9, 161, 3.0); rank.add_edge(17, 186, 1.0); - rank.add_node(529, ()); + rank.get_new_nodeid(); rank.add_edge(9, 49, 1.0); rank.add_edge(48, 251, 1.0); rank.add_edge(6, 156, 1.0); - rank.add_node(530, ()); + rank.get_new_nodeid(); rank.add_edge(210, 209, 1.0); rank.add_edge(110, 17, -1.0); rank.add_edge(131, 48, 1.0); rank.add_edge(31, 208, 1.0); - rank.add_node(531, ()); + rank.get_new_nodeid(); rank.add_edge(187, 186, 1.0); rank.add_edge(157, 0, 1.0); rank.add_edge(519, 10, 1.0); rank.add_edge(39, 241, 6.0); rank.add_edge(159, 302, 1.0); - rank.add_node(532, ()); + rank.get_new_nodeid(); rank.add_edge(74, 73, 1.0); - rank.add_node(533, ()); + rank.get_new_nodeid(); rank.add_edge(336, 396, 1.0); - rank.add_node(534, ()); - rank.add_node(535, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(503, 151, 1.0); rank.add_edge(337, 336, 1.0); rank.add_edge(120, 174, 1.0); rank.add_edge(48, 254, 6.0); - rank.add_node(536, ()); + rank.get_new_nodeid(); rank.add_edge(268, 93, 1.0); rank.add_edge(292, 27, 1.0); rank.add_edge(9, 231, -1.0); rank.add_edge(27, 311, 1.0); rank.add_edge(369, 21, 1.0); rank.add_edge(524, 7, -2.0); - rank.add_node(537, ()); + rank.get_new_nodeid(); rank.add_edge(48, 175, 3.0); rank.add_edge(9, 191, -1.0); rank.add_edge(110, 64, 3.0); @@ -1768,559 +1768,559 @@ mod tests { #[test] fn smoke_perf_with_zero() { - let mut rank = MeritRank::new(Graph::<()>::new()).unwrap(); + let mut rank = MeritRank::new(Graph::new()).unwrap(); - rank.add_node(0, ()); - rank.add_node(1, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(0, 1, 1.0); - rank.add_node(2, ()); - rank.add_node(3, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(2, 3, 1.0); - rank.add_node(4, ()); - rank.add_node(5, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(4, 5, 9.0); - rank.add_node(6, ()); - rank.add_node(7, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(6, 7, 7.0); - rank.add_node(8, ()); + rank.get_new_nodeid(); rank.add_edge(8, 3, 1.0); - rank.add_node(9, ()); - rank.add_node(10, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(9, 10, 3.0); - rank.add_node(11, ()); + rank.get_new_nodeid(); rank.add_edge(11, 3, 1.0); - rank.add_node(12, ()); + rank.get_new_nodeid(); rank.add_edge(12, 3, 1.0); - rank.add_node(13, ()); - rank.add_node(14, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(13, 14, -1.0); - rank.add_node(15, ()); + rank.get_new_nodeid(); rank.add_edge(15, 3, 1.0); - rank.add_node(16, ()); - rank.add_node(17, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(16, 17, -1.0); - rank.add_node(18, ()); + rank.get_new_nodeid(); rank.add_edge(18, 3, 1.0); - rank.add_node(19, ()); - rank.add_node(20, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(19, 20, 1.0); - rank.add_node(21, ()); - rank.add_node(22, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(21, 22, 1.0); - rank.add_node(23, ()); - rank.add_node(24, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(23, 24, 0.0); - rank.add_node(25, ()); + rank.get_new_nodeid(); rank.add_edge(9, 25, 1.0); - rank.add_node(26, ()); - rank.add_node(27, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(26, 27, 1.0); - rank.add_node(28, ()); + rank.get_new_nodeid(); rank.add_edge(28, 3, 1.0); - rank.add_node(29, ()); + rank.get_new_nodeid(); rank.add_edge(29, 3, 1.0); - rank.add_node(30, ()); + rank.get_new_nodeid(); rank.add_edge(30, 22, 4.0); - rank.add_node(31, ()); - rank.add_node(32, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(31, 32, 1.0); - rank.add_node(33, ()); + rank.get_new_nodeid(); rank.add_edge(33, 3, 1.0); - rank.add_node(34, ()); + rank.get_new_nodeid(); rank.add_edge(13, 34, -1.0); - rank.add_node(35, ()); + rank.get_new_nodeid(); rank.add_edge(9, 35, 1.0); - rank.add_node(36, ()); - rank.add_node(37, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(36, 37, 1.0); - rank.add_node(38, ()); - rank.add_node(39, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(38, 39, 1.0); - rank.add_node(40, ()); + rank.get_new_nodeid(); rank.add_edge(40, 3, 1.0); - rank.add_node(41, ()); + rank.get_new_nodeid(); rank.add_edge(41, 3, 1.0); - rank.add_node(42, ()); + rank.get_new_nodeid(); rank.add_edge(42, 1, 6.0); rank.add_edge(35, 14, -1.0); - rank.add_node(43, ()); + rank.get_new_nodeid(); rank.add_edge(43, 3, 1.0); - rank.add_node(44, ()); + rank.get_new_nodeid(); rank.add_edge(44, 3, 1.0); - rank.add_node(45, ()); - rank.add_node(46, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(45, 46, -2.0); - rank.add_node(47, ()); + rank.get_new_nodeid(); rank.add_edge(47, 3, 1.0); - rank.add_node(48, ()); - rank.add_node(49, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(48, 49, -1.0); - rank.add_node(50, ()); - rank.add_node(51, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(50, 51, 5.0); rank.add_edge(24, 27, 1.0); rank.add_edge(31, 27, 1.0); - rank.add_node(52, ()); + rank.get_new_nodeid(); rank.add_edge(52, 3, 1.0); - rank.add_node(53, ()); - rank.add_node(54, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(53, 54, 1.0); - rank.add_node(55, ()); + rank.get_new_nodeid(); rank.add_edge(55, 3, 1.0); - rank.add_node(56, ()); + rank.get_new_nodeid(); rank.add_edge(56, 3, 1.0); - rank.add_node(57, ()); + rank.get_new_nodeid(); rank.add_edge(57, 3, 1.0); - rank.add_node(58, ()); + rank.get_new_nodeid(); rank.add_edge(58, 3, 1.0); - rank.add_node(59, ()); - rank.add_node(60, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(59, 60, 1.0); - rank.add_node(61, ()); - rank.add_node(62, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(61, 62, 1.0); - rank.add_node(63, ()); + rank.get_new_nodeid(); rank.add_edge(63, 24, -2.0); - rank.add_node(64, ()); + rank.get_new_nodeid(); rank.add_edge(64, 0, 1.0); - rank.add_node(65, ()); - rank.add_node(66, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(65, 66, 1.0); - rank.add_node(67, ()); + rank.get_new_nodeid(); rank.add_edge(67, 3, 1.0); - rank.add_node(68, ()); + rank.get_new_nodeid(); rank.add_edge(68, 7, 2.0); - rank.add_node(69, ()); + rank.get_new_nodeid(); rank.add_edge(69, 3, 1.0); rank.add_edge(30, 49, 6.0); - rank.add_node(70, ()); + rank.get_new_nodeid(); rank.add_edge(70, 22, 3.0); - rank.add_node(71, ()); + rank.get_new_nodeid(); rank.add_edge(53, 71, 1.0); - rank.add_node(72, ()); + rank.get_new_nodeid(); rank.add_edge(72, 48, 1.0); - rank.add_node(73, ()); - rank.add_node(74, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(73, 74, 1.0); rank.add_edge(21, 6, -1.0); - rank.add_node(75, ()); - rank.add_node(76, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(75, 76, 1.0); rank.add_edge(70, 14, 1.0); - rank.add_node(77, ()); + rank.get_new_nodeid(); rank.add_edge(77, 3, 1.0); - rank.add_node(78, ()); + rank.get_new_nodeid(); rank.add_edge(78, 24, 1.0); - rank.add_node(79, ()); + rank.get_new_nodeid(); rank.add_edge(79, 3, 1.0); - rank.add_node(80, ()); + rank.get_new_nodeid(); rank.add_edge(80, 3, 1.0); - rank.add_node(81, ()); + rank.get_new_nodeid(); rank.add_edge(9, 81, -1.0); - rank.add_node(82, ()); - rank.add_node(83, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(82, 83, 1.0); rank.add_edge(23, 3, 1.0); - rank.add_node(84, ()); + rank.get_new_nodeid(); rank.add_edge(84, 51, 1.0); - rank.add_node(85, ()); - rank.add_node(86, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(85, 86, 1.0); - rank.add_node(87, ()); + rank.get_new_nodeid(); rank.add_edge(87, 3, 1.0); - rank.add_node(88, ()); + rank.get_new_nodeid(); rank.add_edge(88, 48, 1.0); - rank.add_node(89, ()); - rank.add_node(90, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(89, 90, 1.0); - rank.add_node(91, ()); + rank.get_new_nodeid(); rank.add_edge(91, 3, 1.0); - rank.add_node(92, ()); - rank.add_node(93, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(92, 93, 1.0); - rank.add_node(94, ()); - rank.add_node(95, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(94, 95, -1.0); - rank.add_node(96, ()); + rank.get_new_nodeid(); rank.add_edge(93, 96, 1.0); - rank.add_node(97, ()); + rank.get_new_nodeid(); rank.add_edge(97, 88, 8.0); - rank.add_node(98, ()); + rank.get_new_nodeid(); rank.add_edge(13, 98, -1.0); rank.add_edge(31, 42, 1.0); - rank.add_node(99, ()); + rank.get_new_nodeid(); rank.add_edge(99, 3, 1.0); rank.add_edge(13, 51, -1.0); - rank.add_node(100, ()); + rank.get_new_nodeid(); rank.add_edge(9, 100, -1.0); rank.add_edge(68, 96, 1.0); - rank.add_node(101, ()); + rank.get_new_nodeid(); rank.add_edge(101, 3, 1.0); - rank.add_node(102, ()); - rank.add_node(103, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(102, 103, 1.0); - rank.add_node(104, ()); + rank.get_new_nodeid(); rank.add_edge(104, 76, 1.0); - rank.add_node(105, ()); - rank.add_node(106, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(105, 106, 1.0); - rank.add_node(107, ()); + rank.get_new_nodeid(); rank.add_edge(107, 72, 0.0); - rank.add_node(108, ()); + rank.get_new_nodeid(); rank.add_edge(108, 1, 14.0); - rank.add_node(109, ()); - rank.add_node(110, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(109, 110, 1.0); - rank.add_node(111, ()); + rank.get_new_nodeid(); rank.add_edge(50, 111, 6.0); - rank.add_node(112, ()); + rank.get_new_nodeid(); rank.add_edge(112, 76, 1.0); - rank.add_node(113, ()); + rank.get_new_nodeid(); rank.add_edge(113, 27, 1.0); - rank.add_node(114, ()); - rank.add_node(115, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(114, 115, 4.0); - rank.add_node(116, ()); + rank.get_new_nodeid(); rank.add_edge(110, 116, 1.0); rank.add_edge(9, 32, 1.0); - rank.add_node(117, ()); - rank.add_node(118, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(117, 118, 1.0); - rank.add_node(119, ()); - rank.add_node(120, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(119, 120, 1.0); - rank.add_node(121, ()); + rank.get_new_nodeid(); rank.add_edge(59, 121, 1.0); - rank.add_node(122, ()); + rank.get_new_nodeid(); rank.add_edge(122, 3, 1.0); - rank.add_node(123, ()); + rank.get_new_nodeid(); rank.add_edge(123, 105, 1.0); - rank.add_node(124, ()); - rank.add_node(125, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(124, 125, 1.0); - rank.add_node(126, ()); + rank.get_new_nodeid(); rank.add_edge(27, 126, 1.0); - rank.add_node(127, ()); + rank.get_new_nodeid(); rank.add_edge(127, 3, 1.0); - rank.add_node(128, ()); + rank.get_new_nodeid(); rank.add_edge(85, 128, 1.0); - rank.add_node(129, ()); + rank.get_new_nodeid(); rank.add_edge(104, 129, 1.0); rank.add_edge(27, 26, 1.0); - rank.add_node(130, ()); + rank.get_new_nodeid(); rank.add_edge(130, 3, 1.0); - rank.add_node(131, ()); + rank.get_new_nodeid(); rank.add_edge(114, 131, 2.0); - rank.add_node(132, ()); + rank.get_new_nodeid(); rank.add_edge(132, 1, 1.0); - rank.add_node(133, ()); + rank.get_new_nodeid(); rank.add_edge(133, 3, 1.0); rank.add_edge(9, 125, 1.0); - rank.add_node(134, ()); + rank.get_new_nodeid(); rank.add_edge(82, 134, 1.0); - rank.add_node(135, ()); + rank.get_new_nodeid(); rank.add_edge(135, 56, 1.0); rank.add_edge(84, 88, 9.0); - rank.add_node(136, ()); + rank.get_new_nodeid(); rank.add_edge(136, 3, 1.0); - rank.add_node(137, ()); + rank.get_new_nodeid(); rank.add_edge(21, 137, 1.0); - rank.add_node(138, ()); + rank.get_new_nodeid(); rank.add_edge(138, 3, 1.0); - rank.add_node(139, ()); + rank.get_new_nodeid(); rank.add_edge(9, 139, 1.0); - rank.add_node(140, ()); - rank.add_node(141, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(140, 141, 1.0); - rank.add_node(142, ()); + rank.get_new_nodeid(); rank.add_edge(142, 25, 1.0); rank.add_edge(9, 98, -1.0); - rank.add_node(143, ()); + rank.get_new_nodeid(); rank.add_edge(143, 3, 1.0); - rank.add_node(144, ()); + rank.get_new_nodeid(); rank.add_edge(144, 3, 1.0); - rank.add_node(145, ()); - rank.add_node(146, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(145, 146, 8.0); - rank.add_node(147, ()); + rank.get_new_nodeid(); rank.add_edge(97, 147, 1.0); - rank.add_node(148, ()); - rank.add_node(149, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(148, 149, 1.0); rank.add_edge(9, 24, 3.0); - rank.add_node(150, ()); + rank.get_new_nodeid(); rank.add_edge(150, 46, 2.0); - rank.add_node(151, ()); - rank.add_node(152, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(151, 152, 1.0); - rank.add_node(153, ()); - rank.add_node(154, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(153, 154, 3.0); rank.add_edge(13, 46, 1.0); - rank.add_node(155, ()); + rank.get_new_nodeid(); rank.add_edge(155, 31, 1.0); rank.add_edge(69, 14, 2.0); rank.add_edge(4, 76, 1.0); - rank.add_node(156, ()); + rank.get_new_nodeid(); rank.add_edge(35, 156, -1.0); - rank.add_node(157, ()); + rank.get_new_nodeid(); rank.add_edge(31, 157, 1.0); - rank.add_node(158, ()); - rank.add_node(159, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(158, 159, 1.0); rank.add_edge(69, 129, 2.0); - rank.add_node(160, ()); + rank.get_new_nodeid(); rank.add_edge(160, 3, 1.0); - rank.add_node(161, ()); + rank.get_new_nodeid(); rank.add_edge(27, 161, 1.0); - rank.add_node(162, ()); + rank.get_new_nodeid(); rank.add_edge(162, 76, -1.0); rank.add_edge(45, 3, 1.0); - rank.add_node(163, ()); + rank.get_new_nodeid(); rank.add_edge(163, 3, 1.0); rank.add_edge(19, 81, 1.0); - rank.add_node(164, ()); + rank.get_new_nodeid(); rank.add_edge(164, 3, 1.0); rank.add_edge(147, 97, 1.0); - rank.add_node(165, ()); + rank.get_new_nodeid(); rank.add_edge(124, 165, 1.0); rank.add_edge(161, 27, 1.0); - rank.add_node(166, ()); + rank.get_new_nodeid(); rank.add_edge(166, 3, 1.0); rank.add_edge(9, 54, 3.0); rank.add_edge(65, 24, 2.0); rank.add_edge(48, 3, 1.0); - rank.add_node(167, ()); + rank.get_new_nodeid(); rank.add_edge(167, 3, 1.0); rank.add_edge(151, 3, 1.0); - rank.add_node(168, ()); + rank.get_new_nodeid(); rank.add_edge(107, 168, 1.0); rank.add_edge(65, 3, 1.0); - rank.add_node(169, ()); + rank.get_new_nodeid(); rank.add_edge(169, 3, 1.0); - rank.add_node(170, ()); + rank.get_new_nodeid(); rank.add_edge(27, 170, 1.0); rank.add_edge(149, 24, 5.0); - rank.add_node(171, ()); + rank.get_new_nodeid(); rank.add_edge(70, 171, 1.0); rank.add_edge(110, 72, -1.0); - rank.add_node(172, ()); + rank.get_new_nodeid(); rank.add_edge(172, 69, 1.0); - rank.add_node(173, ()); + rank.get_new_nodeid(); rank.add_edge(113, 173, -11.0); rank.add_edge(104, 75, 4.0); rank.add_edge(125, 9, 1.0); - rank.add_node(174, ()); + rank.get_new_nodeid(); rank.add_edge(31, 174, 1.0); rank.add_edge(0, 10, 1.0); - rank.add_node(175, ()); + rank.get_new_nodeid(); rank.add_edge(13, 175, -1.0); - rank.add_node(176, ()); + rank.get_new_nodeid(); rank.add_edge(176, 35, 1.0); - rank.add_node(177, ()); + rank.get_new_nodeid(); rank.add_edge(177, 3, 1.0); - rank.add_node(178, ()); + rank.get_new_nodeid(); rank.add_edge(178, 3, 1.0); rank.add_edge(84, 3, 1.0); - rank.add_node(179, ()); + rank.get_new_nodeid(); rank.add_edge(179, 3, 1.0); - rank.add_node(180, ()); + rank.get_new_nodeid(); rank.add_edge(180, 95, 3.0); rank.add_edge(69, 12, 1.0); rank.add_edge(150, 3, 1.0); rank.add_edge(13, 9, 1.0); rank.add_edge(146, 4, 1.0); - rank.add_node(181, ()); - rank.add_node(182, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(181, 182, 1.0); rank.add_edge(0, 24, 1.0); - rank.add_node(183, ()); - rank.add_node(184, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(183, 184, 1.0); - rank.add_node(185, ()); + rank.get_new_nodeid(); rank.add_edge(185, 13, 1.0); rank.add_edge(9, 46, 3.0); rank.add_edge(48, 162, 1.0); rank.add_edge(31, 13, 1.0); - rank.add_node(186, ()); - rank.add_node(187, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(186, 187, 1.0); - rank.add_node(188, ()); + rank.get_new_nodeid(); rank.add_edge(188, 3, 1.0); rank.add_edge(4, 14, 9.0); - rank.add_node(189, ()); + rank.get_new_nodeid(); rank.add_edge(189, 3, 1.0); - rank.add_node(190, ()); - rank.add_node(191, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(190, 191, -1.0); rank.add_edge(116, 110, 1.0); - rank.add_node(192, ()); + rank.get_new_nodeid(); rank.add_edge(192, 24, -1.0); rank.add_edge(47, 175, 3.0); - rank.add_node(193, ()); + rank.get_new_nodeid(); rank.add_edge(193, 3, 1.0); - rank.add_node(194, ()); + rank.get_new_nodeid(); rank.add_edge(50, 194, 1.0); - rank.add_node(195, ()); + rank.get_new_nodeid(); rank.add_edge(195, 3, 1.0); rank.add_edge(31, 35, 1.0); rank.add_edge(145, 191, 3.0); rank.add_edge(31, 9, 1.0); rank.add_edge(31, 51, -1.0); rank.add_edge(19, 154, 6.0); - rank.add_node(196, ()); + rank.get_new_nodeid(); rank.add_edge(196, 3, 1.0); - rank.add_node(197, ()); + rank.get_new_nodeid(); rank.add_edge(197, 3, 1.0); rank.add_edge(76, 114, -1.0); rank.add_edge(35, 81, -1.0); - rank.add_node(198, ()); + rank.get_new_nodeid(); rank.add_edge(198, 3, 1.0); - rank.add_node(199, ()); + rank.get_new_nodeid(); rank.add_edge(199, 3, 1.0); rank.add_edge(48, 22, 5.0); - rank.add_node(200, ()); + rank.get_new_nodeid(); rank.add_edge(200, 3, 1.0); - rank.add_node(201, ()); + rank.get_new_nodeid(); rank.add_edge(201, 3, 1.0); - rank.add_node(202, ()); + rank.get_new_nodeid(); rank.add_edge(4, 202, 4.0); rank.add_edge(31, 34, -1.0); - rank.add_node(203, ()); + rank.get_new_nodeid(); rank.add_edge(203, 3, 1.0); - rank.add_node(204, ()); + rank.get_new_nodeid(); rank.add_edge(9, 204, -1.0); rank.add_edge(19, 49, 1.0); - rank.add_node(205, ()); + rank.get_new_nodeid(); rank.add_edge(205, 35, 1.0); - rank.add_node(206, ()); + rank.get_new_nodeid(); rank.add_edge(27, 206, 1.0); rank.add_edge(83, 13, 1.0); rank.add_edge(110, 13, 1.0); rank.add_edge(82, 46, 1.0); rank.add_edge(114, 168, -1.0); rank.add_edge(12, 173, 1.0); - rank.add_node(207, ()); + rank.get_new_nodeid(); rank.add_edge(207, 3, 1.0); - rank.add_node(208, ()); + rank.get_new_nodeid(); rank.add_edge(9, 208, 3.0); - rank.add_node(209, ()); - rank.add_node(210, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(209, 210, 1.0); - rank.add_node(211, ()); + rank.get_new_nodeid(); rank.add_edge(211, 3, 1.0); - rank.add_node(212, ()); + rank.get_new_nodeid(); rank.add_edge(113, 212, 1.0); - rank.add_node(213, ()); + rank.get_new_nodeid(); rank.add_edge(76, 213, 1.0); rank.add_edge(31, 185, 1.0); rank.add_edge(6, 70, 1.0); - rank.add_node(214, ()); + rank.get_new_nodeid(); rank.add_edge(214, 3, 1.0); - rank.add_node(215, ()); + rank.get_new_nodeid(); rank.add_edge(215, 205, 5.0); - rank.add_node(216, ()); + rank.get_new_nodeid(); rank.add_edge(216, 31, 1.0); rank.add_edge(153, 114, 1.0); rank.add_edge(62, 3, 1.0); - rank.add_node(217, ()); + rank.get_new_nodeid(); rank.add_edge(217, 3, 1.0); rank.add_edge(183, 1, 3.0); - rank.add_node(218, ()); + rank.get_new_nodeid(); rank.add_edge(218, 3, 1.0); rank.add_edge(110, 175, -9.0); - rank.add_node(219, ()); + rank.get_new_nodeid(); rank.add_edge(219, 3, 1.0); rank.add_edge(132, 7, -1.0); - rank.add_node(220, ()); + rank.get_new_nodeid(); rank.add_edge(220, 151, 1.0); rank.add_edge(30, 3, 1.0); rank.add_edge(124, 205, 1.0); rank.add_edge(103, 102, 1.0); - rank.add_node(221, ()); + rank.get_new_nodeid(); rank.add_edge(221, 3, 1.0); rank.add_edge(215, 35, 1.0); rank.add_edge(108, 115, -4.0); rank.add_edge(74, 3, 1.0); - rank.add_node(222, ()); + rank.get_new_nodeid(); rank.add_edge(222, 3, 1.0); - rank.add_node(223, ()); + rank.get_new_nodeid(); rank.add_edge(50, 223, 3.0); - rank.add_node(224, ()); + rank.get_new_nodeid(); rank.add_edge(224, 3, 1.0); - rank.add_node(225, ()); + rank.get_new_nodeid(); rank.add_edge(225, 77, 1.0); - rank.add_node(226, ()); + rank.get_new_nodeid(); rank.add_edge(226, 3, 1.0); rank.add_edge(39, 75, 2.0); rank.add_edge(104, 153, -1.0); rank.add_edge(145, 75, -1.0); rank.add_edge(82, 165, 1.0); - rank.add_node(227, ()); + rank.get_new_nodeid(); rank.add_edge(35, 227, 1.0); - rank.add_node(228, ()); + rank.get_new_nodeid(); rank.add_edge(35, 228, 1.0); - rank.add_node(229, ()); - rank.add_node(230, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(229, 230, 1.0); - rank.add_node(231, ()); + rank.get_new_nodeid(); rank.add_edge(231, 150, 1.0); - rank.add_node(232, ()); + rank.get_new_nodeid(); rank.add_edge(232, 3, 1.0); rank.add_edge(113, 18, 1.0); - rank.add_node(233, ()); + rank.get_new_nodeid(); rank.add_edge(233, 9, 1.0); rank.add_edge(210, 24, -2.0); rank.add_edge(31, 191, -1.0); - rank.add_node(234, ()); + rank.get_new_nodeid(); rank.add_edge(234, 3, 1.0); rank.add_edge(9, 26, 2.0); - rank.add_node(235, ()); + rank.get_new_nodeid(); rank.add_edge(235, 3, 1.0); - rank.add_node(236, ()); + rank.get_new_nodeid(); rank.add_edge(236, 107, 1.0); - rank.add_node(237, ()); + rank.get_new_nodeid(); rank.add_edge(31, 237, 1.0); rank.add_edge(98, 215, 1.0); rank.add_edge(145, 3, 1.0); - rank.add_node(238, ()); + rank.get_new_nodeid(); rank.add_edge(238, 3, 1.0); - rank.add_node(239, ()); + rank.get_new_nodeid(); rank.add_edge(239, 46, 4.0); rank.add_edge(100, 19, 1.0); - rank.add_node(240, ()); + rank.get_new_nodeid(); rank.add_edge(6, 240, 1.0); rank.add_edge(108, 72, -8.0); rank.add_edge(9, 175, -1.0); rank.add_edge(27, 3, 1.0); - rank.add_node(241, ()); + rank.get_new_nodeid(); rank.add_edge(241, 39, 1.0); rank.add_edge(230, 1, -2.0); rank.add_edge(82, 237, 1.0); - rank.add_node(242, ()); + rank.get_new_nodeid(); rank.add_edge(242, 53, 1.0); - rank.add_node(243, ()); + rank.get_new_nodeid(); rank.add_edge(243, 186, 1.0); - rank.add_node(244, ()); + rank.get_new_nodeid(); rank.add_edge(114, 244, 2.0); - rank.add_node(245, ()); + rank.get_new_nodeid(); rank.add_edge(245, 3, 1.0); - rank.add_node(246, ()); + rank.get_new_nodeid(); rank.add_edge(30, 246, 5.0); rank.add_edge(19, 244, 1.0); rank.add_edge(39, 49, 4.0); - rank.add_node(247, ()); + rank.get_new_nodeid(); rank.add_edge(247, 77, 1.0); rank.add_edge(20, 19, 1.0); rank.add_edge(4, 213, 8.0); rank.add_edge(30, 240, 3.0); - rank.add_node(248, ()); + rank.get_new_nodeid(); rank.add_edge(248, 3, 1.0); - rank.add_node(249, ()); + rank.get_new_nodeid(); rank.add_edge(249, 12, 1.0); rank.add_edge(13, 83, 1.0); rank.add_edge(121, 59, 1.0); - rank.add_node(250, ()); + rank.get_new_nodeid(); rank.add_edge(250, 153, 1.0); rank.add_edge(13, 109, -1.0); rank.add_edge(150, 24, 4.0); @@ -2330,200 +2330,200 @@ mod tests { rank.add_edge(151, 7, 0.0); rank.add_edge(6, 111, 1.0); rank.add_edge(104, 3, 1.0); - rank.add_node(251, ()); + rank.get_new_nodeid(); rank.add_edge(9, 251, -1.0); - rank.add_node(252, ()); + rank.get_new_nodeid(); rank.add_edge(9, 252, 3.0); - rank.add_node(253, ()); + rank.get_new_nodeid(); rank.add_edge(253, 3, 1.0); rank.add_edge(4, 246, 4.0); - rank.add_node(254, ()); + rank.get_new_nodeid(); rank.add_edge(145, 254, 1.0); - rank.add_node(255, ()); - rank.add_node(256, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(255, 256, 1.0); rank.add_edge(18, 139, 1.0); rank.add_edge(21, 22, 5.0); - rank.add_node(257, ()); + rank.get_new_nodeid(); rank.add_edge(9, 257, 1.0); - rank.add_node(258, ()); + rank.get_new_nodeid(); rank.add_edge(27, 258, 1.0); rank.add_edge(150, 172, -5.0); rank.add_edge(159, 24, -1.0); - rank.add_node(259, ()); + rank.get_new_nodeid(); rank.add_edge(259, 24, -1.0); rank.add_edge(35, 1, -1.0); - rank.add_node(260, ()); + rank.get_new_nodeid(); rank.add_edge(31, 260, 1.0); - rank.add_node(261, ()); + rank.get_new_nodeid(); rank.add_edge(21, 261, 9.0); rank.add_edge(255, 3, 1.0); - rank.add_node(262, ()); + rank.get_new_nodeid(); rank.add_edge(262, 3, 1.0); - rank.add_node(263, ()); + rank.get_new_nodeid(); rank.add_edge(263, 1, 1.0); - rank.add_node(264, ()); + rank.get_new_nodeid(); rank.add_edge(85, 264, 1.0); - rank.add_node(265, ()); + rank.get_new_nodeid(); rank.add_edge(265, 3, 1.0); - rank.add_node(266, ()); + rank.get_new_nodeid(); rank.add_edge(266, 90, 1.0); - rank.add_node(267, ()); + rank.get_new_nodeid(); rank.add_edge(267, 3, 1.0); rank.add_edge(31, 165, 1.0); - rank.add_node(268, ()); + rank.get_new_nodeid(); rank.add_edge(93, 268, 1.0); rank.add_edge(48, 129, -1.0); - rank.add_node(269, ()); + rank.get_new_nodeid(); rank.add_edge(269, 93, 1.0); rank.add_edge(107, 236, 1.0); rank.add_edge(129, 104, 1.0); rank.add_edge(175, 39, 1.0); - rank.add_node(270, ()); + rank.get_new_nodeid(); rank.add_edge(270, 73, -7.0); rank.add_edge(63, 72, 2.0); rank.add_edge(32, 9, 1.0); rank.add_edge(104, 194, 5.0); - rank.add_node(271, ()); - rank.add_node(272, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(271, 272, 1.0); rank.add_edge(246, 76, 1.0); rank.add_edge(31, 155, 1.0); rank.add_edge(21, 20, 2.0); rank.add_edge(82, 3, 1.0); - rank.add_node(273, ()); + rank.get_new_nodeid(); rank.add_edge(273, 3, 1.0); rank.add_edge(31, 14, -1.0); - rank.add_node(274, ()); + rank.get_new_nodeid(); rank.add_edge(274, 84, 1.0); rank.add_edge(48, 72, 1.0); - rank.add_node(275, ()); + rank.get_new_nodeid(); rank.add_edge(275, 3, 1.0); rank.add_edge(13, 100, -1.0); - rank.add_node(276, ()); + rank.get_new_nodeid(); rank.add_edge(276, 3, 1.0); - rank.add_node(277, ()); + rank.get_new_nodeid(); rank.add_edge(277, 44, 1.0); - rank.add_node(278, ()); + rank.get_new_nodeid(); rank.add_edge(69, 278, 4.0); - rank.add_node(279, ()); + rank.get_new_nodeid(); rank.add_edge(279, 45, 1.0); rank.add_edge(162, 75, 7.0); rank.add_edge(6, 69, 1.0); - rank.add_node(280, ()); + rank.get_new_nodeid(); rank.add_edge(280, 3, 1.0); rank.add_edge(255, 257, 1.0); - rank.add_node(281, ()); + rank.get_new_nodeid(); rank.add_edge(281, 3, 1.0); - rank.add_node(282, ()); + rank.get_new_nodeid(); rank.add_edge(282, 3, 1.0); - rank.add_node(283, ()); + rank.get_new_nodeid(); rank.add_edge(283, 3, 1.0); rank.add_edge(82, 185, 1.0); - rank.add_node(284, ()); + rank.get_new_nodeid(); rank.add_edge(284, 3, 1.0); rank.add_edge(45, 279, 1.0); - rank.add_node(285, ()); + rank.get_new_nodeid(); rank.add_edge(285, 3, 1.0); - rank.add_node(286, ()); + rank.get_new_nodeid(); rank.add_edge(27, 286, 1.0); - rank.add_node(287, ()); + rank.get_new_nodeid(); rank.add_edge(287, 3, 1.0); - rank.add_node(288, ()); + rank.get_new_nodeid(); rank.add_edge(288, 3, 1.0); rank.add_edge(239, 3, 1.0); - rank.add_node(289, ()); + rank.get_new_nodeid(); rank.add_edge(289, 24, 1.0); - rank.add_node(290, ()); + rank.get_new_nodeid(); rank.add_edge(21, 290, 1.0); - rank.add_node(291, ()); + rank.get_new_nodeid(); rank.add_edge(291, 3, 1.0); - rank.add_node(292, ()); + rank.get_new_nodeid(); rank.add_edge(27, 292, 1.0); rank.add_edge(115, 12, 1.0); - rank.add_node(293, ()); + rank.get_new_nodeid(); rank.add_edge(293, 3, 1.0); - rank.add_node(294, ()); + rank.get_new_nodeid(); rank.add_edge(9, 294, 1.0); rank.add_edge(13, 204, -1.0); - rank.add_node(295, ()); + rank.get_new_nodeid(); rank.add_edge(295, 3, 1.0); - rank.add_node(296, ()); + rank.get_new_nodeid(); rank.add_edge(13, 296, 1.0); - rank.add_node(297, ()); + rank.get_new_nodeid(); rank.add_edge(297, 3, 1.0); - rank.add_node(298, ()); + rank.get_new_nodeid(); rank.add_edge(298, 110, 1.0); - rank.add_node(299, ()); + rank.get_new_nodeid(); rank.add_edge(299, 3, 1.0); rank.add_edge(35, 165, 1.0); rank.add_edge(113, 17, 3.0); rank.add_edge(151, 220, 1.0); - rank.add_node(300, ()); + rank.get_new_nodeid(); rank.add_edge(300, 3, 1.0); rank.add_edge(35, 191, -1.0); rank.add_edge(16, 24, 2.0); - rank.add_node(301, ()); + rank.get_new_nodeid(); rank.add_edge(301, 159, 1.0); rank.add_edge(124, 25, 1.0); - rank.add_node(302, ()); + rank.get_new_nodeid(); rank.add_edge(302, 159, 1.0); rank.add_edge(39, 72, 7.0); - rank.add_node(303, ()); + rank.get_new_nodeid(); rank.add_edge(303, 3, 1.0); rank.add_edge(84, 147, -1.0); rank.add_edge(9, 14, -1.0); - rank.add_node(304, ()); + rank.get_new_nodeid(); rank.add_edge(304, 257, 1.0); rank.add_edge(50, 173, 9.0); rank.add_edge(141, 24, 2.0); rank.add_edge(35, 205, 1.0); - rank.add_node(305, ()); + rank.get_new_nodeid(); rank.add_edge(163, 305, 1.0); rank.add_edge(244, 19, 1.0); - rank.add_node(306, ()); - rank.add_node(307, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(306, 307, 1.0); rank.add_edge(290, 21, 1.0); rank.add_edge(27, 252, 1.0); - rank.add_node(308, ()); + rank.get_new_nodeid(); rank.add_edge(27, 308, 1.0); rank.add_edge(25, 142, 1.0); - rank.add_node(309, ()); + rank.get_new_nodeid(); rank.add_edge(53, 309, -18.0); - rank.add_node(310, ()); + rank.get_new_nodeid(); rank.add_edge(280, 310, 1.0); - rank.add_node(311, ()); + rank.get_new_nodeid(); rank.add_edge(311, 27, 1.0); rank.add_edge(16, 3, 1.0); rank.add_edge(62, 61, 1.0); rank.add_edge(30, 7, 2.0); - rank.add_node(312, ()); + rank.get_new_nodeid(); rank.add_edge(312, 3, 1.0); rank.add_edge(104, 154, 5.0); - rank.add_node(313, ()); + rank.get_new_nodeid(); rank.add_edge(313, 3, 1.0); - rank.add_node(314, ()); + rank.get_new_nodeid(); rank.add_edge(314, 3, 1.0); - rank.add_node(315, ()); + rank.get_new_nodeid(); rank.add_edge(315, 3, 1.0); - rank.add_node(316, ()); + rank.get_new_nodeid(); rank.add_edge(79, 316, 1.0); - rank.add_node(317, ()); + rank.get_new_nodeid(); rank.add_edge(110, 317, 5.0); rank.add_edge(141, 140, 1.0); rank.add_edge(35, 24, 4.0); rank.add_edge(76, 246, 1.0); - rank.add_node(318, ()); + rank.get_new_nodeid(); rank.add_edge(318, 3, 1.0); rank.add_edge(296, 13, 1.0); rank.add_edge(18, 46, 7.0); - rank.add_node(319, ()); + rank.get_new_nodeid(); rank.add_edge(319, 3, 1.0); rank.add_edge(6, 131, 4.0); - rank.add_node(320, ()); + rank.get_new_nodeid(); rank.add_edge(9, 320, -1.0); - rank.add_node(321, ()); + rank.get_new_nodeid(); rank.add_edge(321, 3, 1.0); rank.add_edge(260, 53, 1.0); rank.add_edge(47, 14, -1.0); @@ -2531,117 +2531,117 @@ mod tests { rank.add_edge(114, 3, 1.0); rank.add_edge(82, 205, 1.0); rank.add_edge(163, 72, 0.0); - rank.add_node(322, ()); + rank.get_new_nodeid(); rank.add_edge(322, 27, 1.0); - rank.add_node(323, ()); + rank.get_new_nodeid(); rank.add_edge(323, 3, 1.0); rank.add_edge(110, 109, 1.0); - rank.add_node(324, ()); + rank.get_new_nodeid(); rank.add_edge(0, 324, 1.0); rank.add_edge(35, 72, -1.0); rank.add_edge(71, 53, 1.0); - rank.add_node(325, ()); + rank.get_new_nodeid(); rank.add_edge(325, 3, 1.0); rank.add_edge(183, 241, -3.0); rank.add_edge(208, 27, 1.0); rank.add_edge(204, 97, 1.0); rank.add_edge(81, 19, 1.0); - rank.add_node(326, ()); + rank.get_new_nodeid(); rank.add_edge(4, 326, 6.0); - rank.add_node(327, ()); + rank.get_new_nodeid(); rank.add_edge(327, 3, 1.0); rank.add_edge(9, 156, -1.0); - rank.add_node(328, ()); + rank.get_new_nodeid(); rank.add_edge(9, 328, 1.0); - rank.add_node(329, ()); + rank.get_new_nodeid(); rank.add_edge(329, 275, 1.0); rank.add_edge(120, 237, 1.0); - rank.add_node(330, ()); + rank.get_new_nodeid(); rank.add_edge(330, 3, 1.0); rank.add_edge(275, 24, -4.0); rank.add_edge(221, 27, 1.0); - rank.add_node(331, ()); + rank.get_new_nodeid(); rank.add_edge(9, 331, 1.0); - rank.add_node(332, ()); + rank.get_new_nodeid(); rank.add_edge(332, 3, 1.0); rank.add_edge(12, 249, 1.0); rank.add_edge(113, 3, 1.0); - rank.add_node(333, ()); + rank.get_new_nodeid(); rank.add_edge(333, 3, 1.0); rank.add_edge(113, 156, -3.0); - rank.add_node(334, ()); + rank.get_new_nodeid(); rank.add_edge(334, 3, 1.0); rank.add_edge(0, 64, 1.0); rank.add_edge(110, 185, 3.0); rank.add_edge(31, 3, 1.0); - rank.add_node(335, ()); + rank.get_new_nodeid(); rank.add_edge(335, 3, 1.0); rank.add_edge(70, 7, 3.0); rank.add_edge(39, 38, 1.0); rank.add_edge(13, 81, -1.0); - rank.add_node(336, ()); - rank.add_node(337, ()); + rank.get_new_nodeid(); + rank.get_new_nodeid(); rank.add_edge(336, 337, 1.0); rank.add_edge(21, 1, 1.0); rank.add_edge(190, 24, 2.0); - rank.add_node(338, ()); + rank.get_new_nodeid(); rank.add_edge(338, 221, 1.0); rank.add_edge(31, 172, -1.0); rank.add_edge(306, 3, 1.0); - rank.add_node(339, ()); + rank.get_new_nodeid(); rank.add_edge(27, 339, 1.0); rank.add_edge(294, 9, 1.0); rank.add_edge(68, 3, 1.0); - rank.add_node(340, ()); + rank.get_new_nodeid(); rank.add_edge(340, 97, 1.0); rank.add_edge(213, 76, 1.0); rank.add_edge(49, 19, 1.0); rank.add_edge(69, 326, 1.0); rank.add_edge(82, 64, 1.0); - rank.add_node(341, ()); + rank.get_new_nodeid(); rank.add_edge(27, 341, 1.0); rank.add_edge(48, 131, 1.0); - rank.add_node(342, ()); + rank.get_new_nodeid(); rank.add_edge(342, 3, 1.0); rank.add_edge(13, 249, -1.0); - rank.add_node(343, ()); + rank.get_new_nodeid(); rank.add_edge(343, 3, 1.0); rank.add_edge(114, 88, 7.0); rank.add_edge(31, 72, -1.0); - rank.add_node(344, ()); + rank.get_new_nodeid(); rank.add_edge(344, 3, 1.0); - rank.add_node(345, ()); + rank.get_new_nodeid(); rank.add_edge(345, 230, 1.0); rank.add_edge(18, 7, -5.0); rank.add_edge(110, 32, 3.0); - rank.add_node(346, ()); + rank.get_new_nodeid(); rank.add_edge(346, 3, 1.0); rank.add_edge(48, 70, 1.0); - rank.add_node(347, ()); + rank.get_new_nodeid(); rank.add_edge(347, 27, 1.0); - rank.add_node(348, ()); + rank.get_new_nodeid(); rank.add_edge(348, 3, 1.0); rank.add_edge(134, 42, 1.0); rank.add_edge(215, 98, 1.0); - rank.add_node(349, ()); + rank.get_new_nodeid(); rank.add_edge(349, 3, 1.0); rank.add_edge(255, 304, 4.0); rank.add_edge(76, 47, -1.0); rank.add_edge(35, 6, 1.0); rank.add_edge(21, 3, 1.0); - rank.add_node(350, ()); + rank.get_new_nodeid(); rank.add_edge(350, 3, 1.0); - rank.add_node(351, ()); + rank.get_new_nodeid(); rank.add_edge(351, 3, 1.0); - rank.add_node(352, ()); + rank.get_new_nodeid(); rank.add_edge(352, 3, 1.0); - rank.add_node(353, ()); + rank.get_new_nodeid(); rank.add_edge(353, 3, 1.0); rank.add_edge(93, 3, 1.0); - rank.add_node(354, ()); + rank.get_new_nodeid(); rank.add_edge(101, 354, 1.0); rank.add_edge(336, 3, 1.0); - rank.add_node(355, ()); + rank.get_new_nodeid(); rank.add_edge(355, 3, 1.0); rank.add_edge(30, 47, 1.0); rank.add_edge(12, 261, -1.0); @@ -2649,38 +2649,38 @@ mod tests { rank.add_edge(31, 119, 1.0); rank.add_edge(264, 85, 1.0); rank.add_edge(230, 241, 1.0); - rank.add_node(356, ()); + rank.get_new_nodeid(); rank.add_edge(356, 3, 1.0); rank.add_edge(85, 3, 1.0); rank.add_edge(149, 3, 1.0); - rank.add_node(357, ()); + rank.get_new_nodeid(); rank.add_edge(357, 44, 1.0); rank.add_edge(240, 48, 1.0); rank.add_edge(153, 3, 1.0); - rank.add_node(358, ()); + rank.get_new_nodeid(); rank.add_edge(358, 3, 1.0); rank.add_edge(12, 22, -1.0); rank.add_edge(105, 3, 1.0); - rank.add_node(359, ()); + rank.get_new_nodeid(); rank.add_edge(359, 31, 1.0); rank.add_edge(95, 284, 1.0); rank.add_edge(239, 172, 2.0); - rank.add_node(360, ()); + rank.get_new_nodeid(); rank.add_edge(360, 3, 1.0); rank.add_edge(149, 32, 5.0); rank.add_edge(86, 85, 1.0); rank.add_edge(31, 216, 1.0); rank.add_edge(21, 191, 1.0); rank.add_edge(272, 271, 1.0); - rank.add_node(361, ()); + rank.get_new_nodeid(); rank.add_edge(361, 93, 1.0); - rank.add_node(362, ()); + rank.get_new_nodeid(); rank.add_edge(362, 3, 1.0); rank.add_edge(0, 157, 1.0); rank.add_edge(35, 204, -1.0); rank.add_edge(110, 3, 1.0); rank.add_edge(69, 172, 1.0); - rank.add_node(363, ()); + rank.get_new_nodeid(); rank.add_edge(363, 259, 1.0); rank.add_edge(257, 304, 1.0); rank.add_edge(9, 213, 1.0); @@ -2688,84 +2688,84 @@ mod tests { rank.add_edge(104, 69, 1.0); rank.add_edge(181, 24, 2.0); rank.add_edge(113, 46, 1.0); - rank.add_node(364, ()); + rank.get_new_nodeid(); rank.add_edge(364, 35, 1.0); rank.add_edge(31, 64, 1.0); - rank.add_node(365, ()); + rank.get_new_nodeid(); rank.add_edge(365, 3, 1.0); rank.add_edge(162, 30, 1.0); - rank.add_node(366, ()); + rank.get_new_nodeid(); rank.add_edge(366, 3, 1.0); rank.add_edge(9, 228, 1.0); rank.add_edge(62, 24, 2.0); rank.add_edge(110, 24, 9.0); - rank.add_node(367, ()); + rank.get_new_nodeid(); rank.add_edge(367, 3, 1.0); rank.add_edge(68, 46, 5.0); rank.add_edge(37, 36, 1.0); - rank.add_node(368, ()); + rank.get_new_nodeid(); rank.add_edge(368, 3, 1.0); - rank.add_node(369, ()); + rank.get_new_nodeid(); rank.add_edge(97, 369, 9.0); - rank.add_node(370, ()); + rank.get_new_nodeid(); rank.add_edge(370, 3, 1.0); rank.add_edge(60, 59, 1.0); rank.add_edge(113, 191, -3.0); rank.add_edge(50, 278, 1.0); - rank.add_node(371, ()); + rank.get_new_nodeid(); rank.add_edge(371, 3, 1.0); rank.add_edge(107, 24, -1.0); rank.add_edge(145, 70, -1.0); rank.add_edge(35, 252, 4.0); rank.add_edge(48, 5, 1.0); - rank.add_node(372, ()); + rank.get_new_nodeid(); rank.add_edge(372, 18, 1.0); rank.add_edge(76, 38, 2.0); rank.add_edge(259, 168, -1.0); - rank.add_node(373, ()); + rank.get_new_nodeid(); rank.add_edge(373, 9, 1.0); - rank.add_node(374, ()); + rank.get_new_nodeid(); rank.add_edge(50, 374, -1.0); rank.add_edge(110, 83, 2.0); - rank.add_node(375, ()); + rank.get_new_nodeid(); rank.add_edge(375, 3, 1.0); - rank.add_node(376, ()); + rank.get_new_nodeid(); rank.add_edge(153, 376, 1.0); rank.add_edge(183, 3, 1.0); rank.add_edge(289, 3, 1.0); - rank.add_node(377, ()); + rank.get_new_nodeid(); rank.add_edge(124, 377, 1.0); rank.add_edge(239, 187, 3.0); rank.add_edge(9, 260, 3.0); - rank.add_node(378, ()); + rank.get_new_nodeid(); rank.add_edge(378, 3, 1.0); rank.add_edge(12, 21, 1.0); rank.add_edge(118, 117, 1.0); - rank.add_node(379, ()); + rank.get_new_nodeid(); rank.add_edge(379, 3, 1.0); rank.add_edge(261, 153, 1.0); rank.add_edge(21, 202, 6.0); - rank.add_node(380, ()); + rank.get_new_nodeid(); rank.add_edge(380, 3, 1.0); - rank.add_node(381, ()); + rank.get_new_nodeid(); rank.add_edge(381, 3, 1.0); rank.add_edge(174, 120, 1.0); rank.add_edge(93, 46, 3.0); - rank.add_node(382, ()); + rank.get_new_nodeid(); rank.add_edge(382, 3, 1.0); - rank.add_node(383, ()); + rank.get_new_nodeid(); rank.add_edge(114, 383, 1.0); rank.add_edge(149, 317, 1.0); rank.add_edge(194, 50, 1.0); - rank.add_node(384, ()); + rank.get_new_nodeid(); rank.add_edge(384, 3, 1.0); - rank.add_node(385, ()); + rank.get_new_nodeid(); rank.add_edge(385, 3, 1.0); - rank.add_node(386, ()); + rank.get_new_nodeid(); rank.add_edge(386, 3, 1.0); rank.add_edge(142, 3, 1.0); rank.add_edge(286, 27, 1.0); - rank.add_node(387, ()); + rank.get_new_nodeid(); rank.add_edge(107, 387, 1.0); rank.add_edge(6, 4, 1.0); rank.add_edge(237, 120, 1.0); @@ -2773,38 +2773,38 @@ mod tests { rank.add_edge(376, 153, 1.0); rank.add_edge(47, 173, 1.0); rank.add_edge(13, 320, -1.0); - rank.add_node(388, ()); + rank.get_new_nodeid(); rank.add_edge(388, 3, 1.0); - rank.add_node(389, ()); + rank.get_new_nodeid(); rank.add_edge(389, 59, 1.0); rank.add_edge(97, 204, 1.0); - rank.add_node(390, ()); + rank.get_new_nodeid(); rank.add_edge(390, 3, 1.0); rank.add_edge(13, 172, -1.0); - rank.add_node(391, ()); + rank.get_new_nodeid(); rank.add_edge(391, 62, 1.0); rank.add_edge(21, 72, 5.0); rank.add_edge(9, 6, 1.0); rank.add_edge(50, 223, 1.0); rank.add_edge(97, 115, -1.0); - rank.add_node(392, ()); + rank.get_new_nodeid(); rank.add_edge(392, 3, 1.0); rank.add_edge(9, 84, 1.0); - rank.add_node(393, ()); + rank.get_new_nodeid(); rank.add_edge(393, 3, 1.0); rank.add_edge(13, 103, -1.0); rank.add_edge(14, 70, 1.0); - rank.add_node(394, ()); + rank.get_new_nodeid(); rank.add_edge(4, 394, 8.0); rank.add_edge(9, 237, 3.0); rank.add_edge(257, 24, -4.0); - rank.add_node(395, ()); + rank.get_new_nodeid(); rank.add_edge(53, 395, 1.0); rank.add_edge(63, 241, 1.0); rank.add_edge(159, 3, 1.0); rank.add_edge(13, 0, 1.0); rank.add_edge(44, 357, 1.0); - rank.add_node(396, ()); + rank.get_new_nodeid(); rank.add_edge(396, 336, 1.0); rank.add_edge(184, 183, 1.0); rank.add_edge(31, 134, 3.0); @@ -2812,37 +2812,37 @@ mod tests { rank.add_edge(120, 3, 1.0); rank.add_edge(228, 3, 1.0); rank.add_edge(113, 139, 3.0); - rank.add_node(397, ()); + rank.get_new_nodeid(); rank.add_edge(397, 3, 1.0); rank.add_edge(154, 97, 1.0); - rank.add_node(398, ()); + rank.get_new_nodeid(); rank.add_edge(270, 398, 1.0); rank.add_edge(13, 191, -1.0); - rank.add_node(399, ()); + rank.get_new_nodeid(); rank.add_edge(399, 65, 1.0); rank.add_edge(50, 131, 9.0); rank.add_edge(104, 112, 3.0); rank.add_edge(13, 383, -1.0); - rank.add_node(400, ()); + rank.get_new_nodeid(); rank.add_edge(400, 3, 1.0); - rank.add_node(401, ()); + rank.get_new_nodeid(); rank.add_edge(401, 53, 1.0); rank.add_edge(31, 175, -1.0); rank.add_edge(113, 208, -1.0); rank.add_edge(53, 242, 1.0); rank.add_edge(128, 85, 1.0); - rank.add_node(402, ()); + rank.get_new_nodeid(); rank.add_edge(402, 3, 1.0); rank.add_edge(42, 3, 1.0); rank.add_edge(104, 47, -1.0); - rank.add_node(403, ()); + rank.get_new_nodeid(); rank.add_edge(403, 3, 1.0); rank.add_edge(110, 298, 1.0); rank.add_edge(97, 340, 3.0); - rank.add_node(404, ()); + rank.get_new_nodeid(); rank.add_edge(404, 3, 1.0); rank.add_edge(9, 142, 1.0); - rank.add_node(405, ()); + rank.get_new_nodeid(); rank.add_edge(336, 405, 1.0); rank.add_edge(94, 398, 1.0); rank.add_edge(124, 35, 0.0); @@ -2851,57 +2851,57 @@ mod tests { rank.add_edge(56, 135, 1.0); rank.add_edge(76, 112, 1.0); rank.add_edge(42, 175, 5.0); - rank.add_node(406, ()); + rank.get_new_nodeid(); rank.add_edge(406, 3, 1.0); - rank.add_node(407, ()); + rank.get_new_nodeid(); rank.add_edge(407, 3, 1.0); rank.add_edge(53, 3, 1.0); rank.add_edge(13, 165, 1.0); rank.add_edge(9, 103, -1.0); rank.add_edge(59, 3, 1.0); - rank.add_node(408, ()); + rank.get_new_nodeid(); rank.add_edge(93, 408, 1.0); - rank.add_node(409, ()); + rank.get_new_nodeid(); rank.add_edge(409, 59, 1.0); - rank.add_node(410, ()); + rank.get_new_nodeid(); rank.add_edge(410, 3, 1.0); rank.add_edge(206, 27, 1.0); rank.add_edge(70, 250, -1.0); rank.add_edge(35, 161, 2.0); rank.add_edge(31, 83, 1.0); - rank.add_node(411, ()); + rank.get_new_nodeid(); rank.add_edge(411, 3, 1.0); rank.add_edge(21, 394, 1.0); rank.add_edge(150, 231, 1.0); - rank.add_node(412, ()); + rank.get_new_nodeid(); rank.add_edge(412, 3, 1.0); - rank.add_node(413, ()); + rank.get_new_nodeid(); rank.add_edge(413, 3, 1.0); rank.add_edge(21, 51, 1.0); rank.add_edge(50, 246, 3.0); rank.add_edge(239, 139, 1.0); - rank.add_node(414, ()); + rank.get_new_nodeid(); rank.add_edge(414, 3, 1.0); rank.add_edge(27, 24, 1.0); rank.add_edge(21, 191, 9.0); rank.add_edge(107, 175, -1.0); - rank.add_node(415, ()); + rank.get_new_nodeid(); rank.add_edge(415, 3, 1.0); rank.add_edge(31, 251, -1.0); rank.add_edge(186, 3, 1.0); rank.add_edge(48, 240, 1.0); rank.add_edge(39, 112, 8.0); - rank.add_node(416, ()); + rank.get_new_nodeid(); rank.add_edge(416, 3, 1.0); rank.add_edge(76, 3, 1.0); rank.add_edge(66, 65, 1.0); - rank.add_node(417, ()); + rank.get_new_nodeid(); rank.add_edge(417, 3, 1.0); rank.add_edge(132, 3, 1.0); rank.add_edge(13, 115, -1.0); rank.add_edge(27, 35, 1.0); rank.add_edge(42, 72, 4.0); - rank.add_node(418, ()); + rank.get_new_nodeid(); rank.add_edge(418, 3, 1.0); rank.add_edge(307, 306, 1.0); rank.add_edge(35, 173, -1.0); @@ -2910,62 +2910,62 @@ mod tests { rank.add_edge(145, 168, 1.0); rank.add_edge(110, 115, -1.0); rank.add_edge(4, 145, 1.0); - rank.add_node(419, ()); + rank.get_new_nodeid(); rank.add_edge(419, 3, 1.0); rank.add_edge(104, 50, 1.0); rank.add_edge(31, 54, 1.0); rank.add_edge(44, 277, 1.0); - rank.add_node(420, ()); + rank.get_new_nodeid(); rank.add_edge(420, 3, 1.0); - rank.add_node(421, ()); + rank.get_new_nodeid(); rank.add_edge(421, 3, 1.0); rank.add_edge(272, 252, 3.0); rank.add_edge(70, 5, 2.0); rank.add_edge(35, 308, 1.0); rank.add_edge(343, 24, 0.0); rank.add_edge(328, 9, 1.0); - rank.add_node(422, ()); + rank.get_new_nodeid(); rank.add_edge(422, 3, 1.0); rank.add_edge(0, 46, 1.0); rank.add_edge(104, 374, 5.0); rank.add_edge(90, 24, 0.0); rank.add_edge(59, 389, 1.0); - rank.add_node(423, ()); + rank.get_new_nodeid(); rank.add_edge(423, 3, 1.0); rank.add_edge(212, 113, 1.0); rank.add_edge(13, 173, -1.0); - rank.add_node(424, ()); + rank.get_new_nodeid(); rank.add_edge(424, 3, 1.0); rank.add_edge(30, 331, 1.0); rank.add_edge(27, 309, 1.0); - rank.add_node(425, ()); + rank.get_new_nodeid(); rank.add_edge(425, 3, 1.0); rank.add_edge(30, 75, 3.0); rank.add_edge(97, 1, 7.0); rank.add_edge(84, 7, 1.0); - rank.add_node(426, ()); + rank.get_new_nodeid(); rank.add_edge(426, 3, 1.0); - rank.add_node(427, ()); + rank.get_new_nodeid(); rank.add_edge(427, 3, 1.0); rank.add_edge(117, 3, 1.0); - rank.add_node(428, ()); + rank.get_new_nodeid(); rank.add_edge(27, 428, 1.0); rank.add_edge(1, 21, 1.0); rank.add_edge(76, 75, 1.0); rank.add_edge(309, 27, 1.0); - rank.add_node(429, ()); + rank.get_new_nodeid(); rank.add_edge(429, 3, 1.0); rank.add_edge(31, 115, -1.0); rank.add_edge(18, 372, 1.0); rank.add_edge(394, 21, 1.0); rank.add_edge(259, 363, 1.0); rank.add_edge(221, 338, 1.0); - rank.add_node(430, ()); + rank.get_new_nodeid(); rank.add_edge(430, 3, 1.0); rank.add_edge(35, 341, 1.0); rank.add_edge(162, 14, 2.0); rank.add_edge(270, 3, 1.0); - rank.add_node(431, ()); + rank.get_new_nodeid(); rank.add_edge(431, 3, 1.0); rank.add_edge(70, 48, 1.0); rank.add_edge(263, 3, 1.0); @@ -2983,41 +2983,41 @@ mod tests { rank.add_edge(162, 115, 3.0); rank.add_edge(162, 278, 1.0); rank.add_edge(50, 3, 1.0); - rank.add_node(432, ()); + rank.get_new_nodeid(); rank.add_edge(30, 432, 1.0); rank.add_edge(84, 274, 1.0); - rank.add_node(433, ()); + rank.get_new_nodeid(); rank.add_edge(433, 3, 1.0); rank.add_edge(47, 6, 1.0); rank.add_edge(68, 24, 3.0); rank.add_edge(191, 21, 1.0); rank.add_edge(105, 24, 0.0); - rank.add_node(434, ()); + rank.get_new_nodeid(); rank.add_edge(434, 3, 1.0); rank.add_edge(4, 202, 1.0); rank.add_edge(19, 111, -1.0); rank.add_edge(31, 113, 1.0); - rank.add_node(435, ()); + rank.get_new_nodeid(); rank.add_edge(435, 3, 1.0); rank.add_edge(230, 229, 1.0); rank.add_edge(341, 27, 1.0); rank.add_edge(42, 134, 1.0); rank.add_edge(258, 27, 1.0); - rank.add_node(436, ()); + rank.get_new_nodeid(); rank.add_edge(221, 436, 1.0); rank.add_edge(93, 361, 1.0); rank.add_edge(9, 174, 3.0); rank.add_edge(62, 391, 1.0); rank.add_edge(19, 278, 4.0); rank.add_edge(35, 7, -1.0); - rank.add_node(437, ()); + rank.get_new_nodeid(); rank.add_edge(45, 437, 1.0); - rank.add_node(438, ()); + rank.get_new_nodeid(); rank.add_edge(438, 289, 1.0); - rank.add_node(439, ()); + rank.get_new_nodeid(); rank.add_edge(439, 3, 1.0); rank.add_edge(54, 53, 1.0); - rank.add_node(440, ()); + rank.get_new_nodeid(); rank.add_edge(440, 3, 1.0); rank.add_edge(107, 1, 1.0); rank.add_edge(0, 3, 1.0); @@ -3030,15 +3030,15 @@ mod tests { rank.add_edge(149, 46, 5.0); rank.add_edge(31, 304, 1.0); rank.add_edge(120, 119, 1.0); - rank.add_node(441, ()); + rank.get_new_nodeid(); rank.add_edge(441, 3, 1.0); rank.add_edge(31, 359, 1.0); - rank.add_node(442, ()); + rank.get_new_nodeid(); rank.add_edge(442, 3, 1.0); rank.add_edge(230, 3, 1.0); - rank.add_node(443, ()); + rank.get_new_nodeid(); rank.add_edge(443, 3, 1.0); - rank.add_node(444, ()); + rank.get_new_nodeid(); rank.add_edge(444, 3, 1.0); rank.add_edge(30, 21, 1.0); rank.add_edge(145, 374, 1.0); @@ -3047,20 +3047,20 @@ mod tests { rank.add_edge(310, 280, 1.0); rank.add_edge(339, 27, 1.0); rank.add_edge(4, 154, 4.0); - rank.add_node(445, ()); + rank.get_new_nodeid(); rank.add_edge(48, 445, 1.0); rank.add_edge(408, 93, 1.0); - rank.add_node(446, ()); + rank.get_new_nodeid(); rank.add_edge(446, 3, 1.0); - rank.add_node(447, ()); + rank.get_new_nodeid(); rank.add_edge(447, 3, 1.0); - rank.add_node(448, ()); + rank.get_new_nodeid(); rank.add_edge(448, 3, 1.0); rank.add_edge(111, 6, 1.0); rank.add_edge(13, 3, 1.0); rank.add_edge(48, 326, 4.0); rank.add_edge(239, 176, 3.0); - rank.add_node(449, ()); + rank.get_new_nodeid(); rank.add_edge(35, 449, 1.0); rank.add_edge(331, 30, 1.0); rank.add_edge(19, 3, 1.0); @@ -3071,61 +3071,61 @@ mod tests { rank.add_edge(13, 24, 2.0); rank.add_edge(107, 3, 1.0); rank.add_edge(63, 1, 1.0); - rank.add_node(450, ()); + rank.get_new_nodeid(); rank.add_edge(450, 90, 1.0); - rank.add_node(451, ()); + rank.get_new_nodeid(); rank.add_edge(451, 3, 1.0); rank.add_edge(360, 42, 1.0); rank.add_edge(6, 3, 1.0); rank.add_edge(59, 24, 1.0); rank.add_edge(13, 208, 2.0); rank.add_edge(82, 32, 1.0); - rank.add_node(452, ()); + rank.get_new_nodeid(); rank.add_edge(105, 452, 1.0); rank.add_edge(124, 3, 1.0); rank.add_edge(78, 3, 1.0); rank.add_edge(163, 251, 1.0); rank.add_edge(428, 27, 1.0); - rank.add_node(453, ()); + rank.get_new_nodeid(); rank.add_edge(275, 453, 1.0); rank.add_edge(278, 162, 1.0); rank.add_edge(9, 1, -1.0); - rank.add_node(454, ()); + rank.get_new_nodeid(); rank.add_edge(454, 3, 1.0); - rank.add_node(455, ()); + rank.get_new_nodeid(); rank.add_edge(455, 280, 1.0); rank.add_edge(35, 339, 1.0); rank.add_edge(432, 30, 1.0); rank.add_edge(288, 24, 1.0); rank.add_edge(252, 27, 1.0); - rank.add_node(456, ()); + rank.get_new_nodeid(); rank.add_edge(456, 46, 4.0); - rank.add_node(457, ()); + rank.get_new_nodeid(); rank.add_edge(457, 3, 1.0); rank.add_edge(181, 3, 1.0); rank.add_edge(153, 261, 1.0); rank.add_edge(255, 46, 2.0); - rank.add_node(458, ()); + rank.get_new_nodeid(); rank.add_edge(141, 458, 1.0); rank.add_edge(35, 176, 1.0); rank.add_edge(162, 261, 8.0); rank.add_edge(31, 139, 1.0); rank.add_edge(9, 113, 1.0); - rank.add_node(459, ()); + rank.get_new_nodeid(); rank.add_edge(459, 3, 1.0); - rank.add_node(460, ()); + rank.get_new_nodeid(); rank.add_edge(460, 3, 1.0); - rank.add_node(461, ()); + rank.get_new_nodeid(); rank.add_edge(306, 461, 1.0); rank.add_edge(63, 168, 0.0); - rank.add_node(462, ()); + rank.get_new_nodeid(); rank.add_edge(186, 462, 1.0); rank.add_edge(308, 27, 1.0); - rank.add_node(463, ()); + rank.get_new_nodeid(); rank.add_edge(463, 3, 1.0); rank.add_edge(47, 20, 3.0); rank.add_edge(76, 137, 8.0); - rank.add_node(464, ()); + rank.get_new_nodeid(); rank.add_edge(464, 3, 1.0); rank.add_edge(153, 115, 2.0); rank.add_edge(31, 173, -1.0); @@ -3133,38 +3133,38 @@ mod tests { rank.add_edge(9, 246, 1.0); rank.add_edge(31, 0, 1.0); rank.add_edge(142, 205, 1.0); - rank.add_node(465, ()); + rank.get_new_nodeid(); rank.add_edge(465, 3, 1.0); rank.add_edge(9, 115, -1.0); rank.add_edge(13, 35, 1.0); rank.add_edge(84, 331, 3.0); rank.add_edge(13, 231, -1.0); - rank.add_node(466, ()); + rank.get_new_nodeid(); rank.add_edge(466, 3, 1.0); rank.add_edge(452, 105, 1.0); - rank.add_node(467, ()); + rank.get_new_nodeid(); rank.add_edge(467, 3, 1.0); rank.add_edge(356, 7, -3.0); - rank.add_node(468, ()); + rank.get_new_nodeid(); rank.add_edge(69, 468, 1.0); rank.add_edge(82, 208, 1.0); rank.add_edge(42, 24, -6.0); - rank.add_node(469, ()); + rank.get_new_nodeid(); rank.add_edge(469, 3, 1.0); rank.add_edge(159, 158, 1.0); rank.add_edge(19, 250, 4.0); rank.add_edge(6, 84, 1.0); - rank.add_node(470, ()); + rank.get_new_nodeid(); rank.add_edge(470, 93, 1.0); rank.add_edge(35, 172, -1.0); rank.add_edge(9, 205, 4.0); - rank.add_node(471, ()); + rank.get_new_nodeid(); rank.add_edge(471, 3, 1.0); rank.add_edge(27, 208, 1.0); rank.add_edge(90, 3, 1.0); rank.add_edge(102, 9, 1.0); rank.add_edge(239, 34, 2.0); - rank.add_node(472, ()); + rank.get_new_nodeid(); rank.add_edge(472, 3, 1.0); rank.add_edge(102, 32, 4.0); rank.add_edge(31, 24, 1.0); @@ -3172,26 +3172,26 @@ mod tests { rank.add_edge(9, 286, 1.0); rank.add_edge(320, 68, 1.0); rank.add_edge(77, 225, 1.0); - rank.add_node(473, ()); + rank.get_new_nodeid(); rank.add_edge(473, 3, 1.0); rank.add_edge(19, 1, 8.0); rank.add_edge(275, 329, 1.0); rank.add_edge(39, 175, 1.0); - rank.add_node(474, ()); + rank.get_new_nodeid(); rank.add_edge(474, 24, 6.0); rank.add_edge(398, 270, 1.0); - rank.add_node(475, ()); + rank.get_new_nodeid(); rank.add_edge(475, 3, 1.0); - rank.add_node(476, ()); + rank.get_new_nodeid(); rank.add_edge(476, 3, 1.0); rank.add_edge(27, 347, 1.0); - rank.add_node(477, ()); + rank.get_new_nodeid(); rank.add_edge(477, 3, 1.0); rank.add_edge(387, 107, 1.0); rank.add_edge(395, 53, 1.0); - rank.add_node(478, ()); + rank.get_new_nodeid(); rank.add_edge(478, 3, 1.0); - rank.add_node(479, ()); + rank.get_new_nodeid(); rank.add_edge(479, 3, 1.0); rank.add_edge(6, 35, 1.0); rank.add_edge(13, 251, -1.0); @@ -3204,12 +3204,12 @@ mod tests { rank.add_edge(35, 208, 3.0); rank.add_edge(21, 369, 1.0); rank.add_edge(162, 3, 1.0); - rank.add_node(480, ()); + rank.get_new_nodeid(); rank.add_edge(480, 3, 1.0); rank.add_edge(59, 409, 1.0); rank.add_edge(21, 35, 1.0); rank.add_edge(65, 399, 1.0); - rank.add_node(481, ()); + rank.get_new_nodeid(); rank.add_edge(481, 3, 1.0); rank.add_edge(257, 46, 4.0); rank.add_edge(256, 255, 1.0); @@ -3217,54 +3217,54 @@ mod tests { rank.add_edge(239, 24, 2.0); rank.add_edge(354, 101, 1.0); rank.add_edge(436, 221, 1.0); - rank.add_node(482, ()); + rank.get_new_nodeid(); rank.add_edge(482, 3, 1.0); rank.add_edge(113, 34, 5.0); rank.add_edge(9, 51, -1.0); rank.add_edge(272, 3, 1.0); rank.add_edge(35, 286, 2.0); - rank.add_node(483, ()); + rank.get_new_nodeid(); rank.add_edge(483, 3, 1.0); rank.add_edge(405, 336, 1.0); rank.add_edge(90, 450, 1.0); - rank.add_node(484, ()); + rank.get_new_nodeid(); rank.add_edge(484, 3, 1.0); - rank.add_node(485, ()); + rank.get_new_nodeid(); rank.add_edge(485, 3, 1.0); rank.add_edge(39, 3, 1.0); rank.add_edge(97, 35, 1.0); rank.add_edge(19, 100, 1.0); - rank.add_node(486, ()); + rank.get_new_nodeid(); rank.add_edge(27, 486, 1.0); rank.add_edge(153, 250, 1.0); rank.add_edge(35, 51, -1.0); - rank.add_node(487, ()); + rank.get_new_nodeid(); rank.add_edge(487, 3, 1.0); - rank.add_node(488, ()); + rank.get_new_nodeid(); rank.add_edge(488, 3, 1.0); rank.add_edge(7, 84, 1.0); rank.add_edge(9, 304, 3.0); rank.add_edge(48, 88, 1.0); rank.add_edge(163, 241, -1.0); - rank.add_node(489, ()); + rank.get_new_nodeid(); rank.add_edge(489, 3, 1.0); rank.add_edge(210, 3, 1.0); rank.add_edge(9, 373, 1.0); rank.add_edge(202, 4, 1.0); rank.add_edge(50, 369, 7.0); rank.add_edge(153, 1, 9.0); - rank.add_node(490, ()); + rank.get_new_nodeid(); rank.add_edge(490, 3, 1.0); - rank.add_node(491, ()); + rank.get_new_nodeid(); rank.add_edge(491, 3, 1.0); rank.add_edge(9, 72, -1.0); - rank.add_node(492, ()); + rank.get_new_nodeid(); rank.add_edge(492, 3, 1.0); - rank.add_node(493, ()); + rank.get_new_nodeid(); rank.add_edge(493, 3, 1.0); rank.add_edge(108, 7, -4.0); rank.add_edge(48, 376, 5.0); - rank.add_node(494, ()); + rank.get_new_nodeid(); rank.add_edge(494, 3, 1.0); rank.add_edge(145, 21, 1.0); rank.add_edge(168, 145, 1.0); @@ -3287,29 +3287,29 @@ mod tests { rank.add_edge(453, 275, 1.0); rank.add_edge(96, 93, 1.0); rank.add_edge(35, 3, 1.0); - rank.add_node(495, ()); + rank.get_new_nodeid(); rank.add_edge(495, 3, 1.0); - rank.add_node(496, ()); + rank.get_new_nodeid(); rank.add_edge(496, 3, 1.0); rank.add_edge(85, 24, 0.0); rank.add_edge(228, 205, 1.0); rank.add_edge(93, 92, 1.0); - rank.add_node(497, ()); + rank.get_new_nodeid(); rank.add_edge(497, 3, 1.0); - rank.add_node(498, ()); + rank.get_new_nodeid(); rank.add_edge(498, 3, 1.0); rank.add_edge(186, 243, 1.0); rank.add_edge(53, 260, 1.0); rank.add_edge(152, 151, 1.0); rank.add_edge(9, 249, -1.0); - rank.add_node(499, ()); + rank.get_new_nodeid(); rank.add_edge(499, 3, 1.0); rank.add_edge(180, 3, 1.0); - rank.add_node(500, ()); + rank.get_new_nodeid(); rank.add_edge(500, 3, 1.0); - rank.add_node(501, ()); + rank.get_new_nodeid(); rank.add_edge(501, 151, 1.0); - rank.add_node(502, ()); + rank.get_new_nodeid(); rank.add_edge(502, 3, 1.0); rank.add_edge(474, 3, 1.0); rank.add_edge(445, 48, 1.0); @@ -3320,38 +3320,38 @@ mod tests { rank.add_edge(90, 266, 1.0); rank.add_edge(31, 205, 1.0); rank.add_edge(69, 48, 1.0); - rank.add_node(503, ()); + rank.get_new_nodeid(); rank.add_edge(151, 503, 1.0); rank.add_edge(4, 374, 2.0); rank.add_edge(190, 3, 1.0); rank.add_edge(84, 194, 6.0); rank.add_edge(4, 223, 1.0); - rank.add_node(504, ()); + rank.get_new_nodeid(); rank.add_edge(504, 3, 1.0); rank.add_edge(449, 35, 1.0); rank.add_edge(221, 24, 1.0); rank.add_edge(69, 171, 8.0); rank.add_edge(149, 208, 2.0); - rank.add_node(505, ()); + rank.get_new_nodeid(); rank.add_edge(505, 3, 1.0); rank.add_edge(35, 364, 1.0); rank.add_edge(30, 137, 5.0); - rank.add_node(506, ()); + rank.get_new_nodeid(); rank.add_edge(506, 3, 1.0); rank.add_edge(162, 84, 1.0); - rank.add_node(507, ()); + rank.get_new_nodeid(); rank.add_edge(507, 3, 1.0); rank.add_edge(77, 247, 1.0); rank.add_edge(13, 32, 1.0); rank.add_edge(35, 258, 1.0); - rank.add_node(508, ()); + rank.get_new_nodeid(); rank.add_edge(508, 3, 1.0); rank.add_edge(437, 45, 1.0); rank.add_edge(462, 186, 1.0); - rank.add_node(509, ()); + rank.get_new_nodeid(); rank.add_edge(509, 3, 1.0); rank.add_edge(133, 24, -3.0); - rank.add_node(510, ()); + rank.get_new_nodeid(); rank.add_edge(510, 3, 1.0); rank.add_edge(124, 27, 1.0); rank.add_edge(383, 114, 1.0); @@ -3361,22 +3361,22 @@ mod tests { rank.add_edge(42, 113, 1.0); rank.add_edge(151, 501, 1.0); rank.add_edge(270, 95, 7.0); - rank.add_node(511, ()); + rank.get_new_nodeid(); rank.add_edge(77, 511, 1.0); - rank.add_node(512, ()); + rank.get_new_nodeid(); rank.add_edge(512, 3, 1.0); rank.add_edge(27, 322, 1.0); - rank.add_node(513, ()); + rank.get_new_nodeid(); rank.add_edge(513, 3, 1.0); rank.add_edge(106, 105, 1.0); rank.add_edge(12, 115, 1.0); rank.add_edge(317, 149, 1.0); - rank.add_node(514, ()); + rank.get_new_nodeid(); rank.add_edge(514, 3, 1.0); rank.add_edge(31, 228, 1.0); - rank.add_node(515, ()); + rank.get_new_nodeid(); rank.add_edge(515, 3, 1.0); - rank.add_node(516, ()); + rank.get_new_nodeid(); rank.add_edge(516, 3, 1.0); rank.add_edge(97, 3, 1.0); rank.add_edge(254, 145, 1.0); @@ -3384,11 +3384,11 @@ mod tests { rank.add_edge(153, 147, 1.0); rank.add_edge(162, 147, 5.0); rank.add_edge(153, 20, -1.0); - rank.add_node(517, ()); + rank.get_new_nodeid(); rank.add_edge(517, 3, 1.0); rank.add_edge(183, 72, -1.0); rank.add_edge(44, 208, 0.0); - rank.add_node(518, ()); + rank.get_new_nodeid(); rank.add_edge(518, 3, 1.0); rank.add_edge(474, 1, -9.0); rank.add_edge(63, 3, 1.0); @@ -3398,7 +3398,7 @@ mod tests { rank.add_edge(70, 3, 1.0); rank.add_edge(59, 17, -1.0); rank.add_edge(105, 123, 1.0); - rank.add_node(519, ()); + rank.get_new_nodeid(); rank.add_edge(10, 519, 1.0); rank.add_edge(34, 47, 1.0); rank.add_edge(223, 50, 1.0); @@ -3408,13 +3408,13 @@ mod tests { rank.add_edge(137, 21, 1.0); rank.add_edge(23, 1, 0.0); rank.add_edge(31, 46, 1.0); - rank.add_node(520, ()); + rank.get_new_nodeid(); rank.add_edge(520, 3, 1.0); rank.add_edge(4, 3, 1.0); - rank.add_node(521, ()); + rank.get_new_nodeid(); rank.add_edge(521, 3, 1.0); rank.add_edge(219, 1, 1.0); - rank.add_node(522, ()); + rank.get_new_nodeid(); rank.add_edge(522, 3, 1.0); rank.add_edge(22, 21, 1.0); rank.add_edge(51, 84, 1.0); @@ -3425,9 +3425,9 @@ mod tests { rank.add_edge(468, 69, 1.0); rank.add_edge(47, 34, 1.0); rank.add_edge(163, 1, -2.0); - rank.add_node(523, ()); + rank.get_new_nodeid(); rank.add_edge(523, 3, 1.0); - rank.add_node(524, ()); + rank.get_new_nodeid(); rank.add_edge(524, 3, 1.0); rank.add_edge(90, 89, 1.0); rank.add_edge(153, 5, 8.0); @@ -3438,54 +3438,54 @@ mod tests { rank.add_edge(511, 77, 1.0); rank.add_edge(84, 30, 1.0); rank.add_edge(94, 3, 1.0); - rank.add_node(525, ()); + rank.get_new_nodeid(); rank.add_edge(525, 3, 1.0); rank.add_edge(170, 27, 1.0); - rank.add_node(526, ()); + rank.get_new_nodeid(); rank.add_edge(526, 3, 1.0); rank.add_edge(173, 12, 1.0); rank.add_edge(30, 204, 5.0); - rank.add_node(527, ()); + rank.get_new_nodeid(); rank.add_edge(527, 3, 1.0); rank.add_edge(42, 7, 2.0); - rank.add_node(528, ()); + rank.get_new_nodeid(); rank.add_edge(528, 3, 1.0); rank.add_edge(9, 161, 3.0); rank.add_edge(17, 186, 1.0); - rank.add_node(529, ()); + rank.get_new_nodeid(); rank.add_edge(529, 3, 1.0); rank.add_edge(9, 49, 1.0); rank.add_edge(48, 251, 1.0); rank.add_edge(6, 156, 1.0); - rank.add_node(530, ()); + rank.get_new_nodeid(); rank.add_edge(530, 3, 1.0); rank.add_edge(210, 209, 1.0); rank.add_edge(110, 17, -1.0); rank.add_edge(131, 48, 1.0); rank.add_edge(31, 208, 1.0); rank.add_edge(259, 3, 1.0); - rank.add_node(531, ()); + rank.get_new_nodeid(); rank.add_edge(531, 3, 1.0); rank.add_edge(187, 186, 1.0); rank.add_edge(157, 0, 1.0); rank.add_edge(519, 10, 1.0); rank.add_edge(39, 241, 6.0); rank.add_edge(159, 302, 1.0); - rank.add_node(532, ()); + rank.get_new_nodeid(); rank.add_edge(532, 3, 1.0); rank.add_edge(74, 73, 1.0); - rank.add_node(533, ()); + rank.get_new_nodeid(); rank.add_edge(533, 3, 1.0); rank.add_edge(336, 396, 1.0); - rank.add_node(534, ()); + rank.get_new_nodeid(); rank.add_edge(534, 3, 1.0); - rank.add_node(535, ()); + rank.get_new_nodeid(); rank.add_edge(535, 3, 1.0); rank.add_edge(503, 151, 1.0); rank.add_edge(337, 336, 1.0); rank.add_edge(120, 174, 1.0); rank.add_edge(48, 254, 6.0); - rank.add_node(536, ()); + rank.get_new_nodeid(); rank.add_edge(536, 3, 1.0); rank.add_edge(268, 93, 1.0); rank.add_edge(292, 27, 1.0); @@ -3493,7 +3493,7 @@ mod tests { rank.add_edge(27, 311, 1.0); rank.add_edge(369, 21, 1.0); rank.add_edge(524, 7, -2.0); - rank.add_node(537, ()); + rank.get_new_nodeid(); rank.add_edge(537, 3, 1.0); rank.add_edge(48, 175, 3.0); rank.add_edge(9, 191, -1.0); From e489b09f8ea0c57404d014bc72568b42e3b96b93 Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Thu, 18 Jul 2024 00:04:23 +0200 Subject: [PATCH 07/12] Optimize edges sum --- src/errors.rs | 2 ++ src/graph.rs | 15 +++++++++++++-- src/rank.rs | 7 +------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 68ea879..af7e258 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,6 +1,7 @@ /// Errors that can occur in the MeritRank implementation. #[derive(Debug, Clone)] pub enum MeritRankError { + ZeroWeightEncountered, NodeDoesNotExist, SelfReferenceNotAllowed, RandomChoiceError, @@ -20,6 +21,7 @@ use std::fmt::{Display, Formatter, Result}; impl Display for MeritRankError { fn fmt(&self, f: &mut Formatter<'_>) -> Result { match self { + MeritRankError::ZeroWeightEncountered => write!(f, "Edge with zero weights are not allowed"), MeritRankError::NodeDoesNotExist => write!(f, "Node does not exist"), MeritRankError::SelfReferenceNotAllowed => write!(f, "Self-reference is not allowed"), MeritRankError::RandomChoiceError => write!(f, "Random choice error"), diff --git a/src/graph.rs b/src/graph.rs index cf6e086..b0a980f 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -18,12 +18,20 @@ pub enum Neighbors { pub struct NodeData{ pos_edges: IntMap, neg_edges: IntMap, + + // The sum of positive edges is often used for normalization, + // so it is efficient to cache it. + pos_sum: Weight, } impl NodeData { + pub fn get_pos_edges_sum(&self) -> Weight { + self.pos_sum + } + pub fn neighbors(&self, mode: Neighbors) -> &IntMap { match mode { //Neighbors::All => Some((nbr, weight)), @@ -67,11 +75,11 @@ impl Graph { } match weight { 0.0 => { - node.pos_edges.remove(&to); - node.neg_edges.remove(&to); + return Err(MeritRankError::ZeroWeightEncountered); }, w if w > 0.0 => { node.pos_edges.insert(to, weight); + node.pos_sum += weight; }, _ => { node.neg_edges.insert(to, weight); @@ -91,6 +99,9 @@ impl Graph { // and get to neg only if pos_weight is None. let pos_weight = node.pos_edges.remove(&to); let neg_weight = node.neg_edges.remove(&to); + + node.pos_sum -= pos_weight.unwrap_or(0.0); + assert!(!(pos_weight.is_some() && neg_weight.is_some())); Ok(pos_weight.or(neg_weight).expect("Edge not found")) } diff --git a/src/rank.rs b/src/rank.rs index 619bb15..697761f 100644 --- a/src/rank.rs +++ b/src/rank.rs @@ -226,12 +226,7 @@ impl MeritRank { assert!(weight >= 0.0); let step_recalc_probability = if OPTIMIZE_INVALIDATION && weight > EPSILON && self.graph.contains_node(src) { - let sum_of_weights: f64 = self.graph - .get_node_data(src) - .unwrap() - .neighbors(Neighbors::Positive) - .values() - .sum(); + let sum_of_weights: f64 = self.graph.get_node_data(src).unwrap().get_pos_edges_sum(); weight / (sum_of_weights + weight) } else { 0.0 From 497c622ef019dc3d4ea8e5589829270f7e8e762c Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Thu, 18 Jul 2024 01:14:46 +0200 Subject: [PATCH 08/12] Small optimizations --- src/debug.rs | 3 +-- src/rank.rs | 52 +++++++++++++++++++++++---------------- src/walk_storage.rs | 40 ++++++++++++++++-------------- tests/test_walkstorage.rs | 38 ++++++++++++++-------------- 4 files changed, 72 insertions(+), 61 deletions(-) diff --git a/src/debug.rs b/src/debug.rs index ade3dce..3051a67 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -13,9 +13,8 @@ impl fmt::Debug for WalkStorage { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Implement the formatting logic for WalkStorage // Here you can format the storage contents as desired - let sorted_walks: std::collections::BTreeMap<_, _> = self.get_walks().iter().collect(); - write!(f, "WalkStorage {{ walks: {:?} }}", sorted_walks) + write!(f, "WalkStorage {{ walks: {:?} }}", self.get_walks()) } } diff --git a/src/rank.rs b/src/rank.rs index 697761f..597f55c 100644 --- a/src/rank.rs +++ b/src/rank.rs @@ -113,8 +113,8 @@ impl MeritRank { let (peers, weights): (Vec<_>, Vec<_>) = neighbors.iter().unzip(); let next_step = Self::random_choice(&peers, &weights, &mut rng) .ok_or(MeritRankError::RandomChoiceError)?; - segment.push(next_step); - node = next_step; + segment.push(*next_step); + node = *next_step; } else { break; } @@ -122,10 +122,18 @@ impl MeritRank { Ok(segment) } - fn random_choice(values: &[T], weights: &[f64], rng: &mut impl Rng) -> Option { - WeightedIndex::new(weights) - .ok() - .and_then(|dist| values.get(dist.sample(rng)).copied()) + + + fn random_choice<'a, T>(values: &'a [T], weights: &[f64], rng: &mut impl Rng) -> Option<&'a T> { + if values.is_empty() || weights.is_empty() || values.len() != weights.len() { + return None; + } + // Idea: optimize by storing the WeightedIndex in the graph for each node? + + match WeightedIndex::new(weights) { + Ok(dist) => values.get(dist.sample(rng)), + Err(_) => None, + } } @@ -186,7 +194,8 @@ impl MeritRank { let ego = walk.first_node().ok_or(MeritRankError::InvalidWalkLength)?; let counter = self.personal_hits.entry(ego).or_insert_with(Counter::new); - let diff = SetUsize::from_iter(new_segment.iter().cloned()) - &SetUsize::from_iter(walk.get_nodes().iter().cloned()); + let diff = SetUsize::from_iter(new_segment.iter().cloned()) + - &SetUsize::from_iter(walk.get_nodes().iter().cloned()); counter.increment_unique_counts(diff.iter()); // Borrow mutable `walk` again for `extend` @@ -226,7 +235,12 @@ impl MeritRank { assert!(weight >= 0.0); let step_recalc_probability = if OPTIMIZE_INVALIDATION && weight > EPSILON && self.graph.contains_node(src) { - let sum_of_weights: f64 = self.graph.get_node_data(src).unwrap().get_pos_edges_sum(); + let sum_of_weights: f64 = self.graph + .get_node_data(src) + .unwrap() + .neighbors(Neighbors::Positive) + .values() + .sum(); weight / (sum_of_weights + weight) } else { 0.0 @@ -357,21 +371,17 @@ fn revert_counters_for_walk_from_pos( let ego = walk.first_node().unwrap(); let counter = personal_hits.entry(ego).or_insert_with(Counter::new); - let nodes_before_pos: SetUsize = walk.get_nodes()[..pos].iter().cloned().collect(); - let nodes_to_remove: SetUsize = walk.get_nodes()[pos..] - .iter() - .cloned() - .filter(|&node| !nodes_before_pos.contains(node)) - .collect(); + let nodes = walk.get_nodes(); + let mut nodes_to_skip: SetUsize = nodes[..pos].iter().copied().collect(); - if !nodes_to_remove.is_empty() { - for node_to_remove in nodes_to_remove { - *counter.get_mut_count(&node_to_remove) -= 1.0; + for node_to_remove in &nodes[pos..] { + if nodes_to_skip.insert(*node_to_remove) { + *counter.get_mut_count(node_to_remove) -= 1.0; } + } - #[cfg(debug_assertions)] - for &c in counter.count_values() { - assert!(c >= 0.0); - } + #[cfg(debug_assertions)] + for &c in counter.count_values() { + assert!(c >= 0.0); } } diff --git a/src/walk_storage.rs b/src/walk_storage.rs index 47fe4a0..61bc6bb 100644 --- a/src/walk_storage.rs +++ b/src/walk_storage.rs @@ -12,7 +12,7 @@ pub type WalkId = usize; /// Represents a storage container for walks in the MeritRank graph. #[derive(Clone)] pub struct WalkStorage { - visits: IntMap>, + visits: Vec>, walks: Vec, unused_walks: VecDeque, } @@ -27,7 +27,7 @@ impl WalkStorage { /// A new `WalkStorage` instance. pub fn new() -> Self { WalkStorage { - visits: IntMap::default(), + visits: Vec::new(), walks: Vec::new(), unused_walks: VecDeque::new(), @@ -44,12 +44,12 @@ impl WalkStorage { self.walks.get_mut(uid) } - pub fn get_walks(&self) -> &IntMap> { + pub fn get_walks(&self) -> &Vec> { &self.visits } pub fn get_visits_through_node(&self, node_id: NodeId) -> Option<&IntMap> { - self.visits.get(&node_id) + self.visits.get(node_id) } @@ -64,17 +64,23 @@ impl WalkStorage { } } + pub fn add_walk_to_bookkeeping(&mut self, walk_id: WalkId, start_pos: usize) { - let walk = &self.walks[walk_id as usize]; - for (pos, &node) in walk.get_nodes().iter().enumerate().skip(start_pos) { - // add the walk to the node - let walks_with_node = self.visits.entry(node).or_insert_with(IntMap::default); - if !walks_with_node.contains_key(&walk_id) { - walks_with_node.insert(walk_id, pos); + if let Some(walk) = self.walks.get(walk_id) { + for (pos, &node) in walk.get_nodes().iter().enumerate().skip(start_pos) { + if self.visits.len() < node+1 { + self.visits.resize(node+1, IntMap::default()); + + } + self.visits[node] + .entry(walk_id) + .or_insert(pos); } } } + + pub fn print_walks(&self) { for walk in &self.walks{ println! ("{:?}", *walk); @@ -105,7 +111,7 @@ impl WalkStorage { /// pub fn drop_walks_from_node(&mut self, node: NodeId) { // Check if there are any visits for the given node - if let Some(visits_for_node) = self.visits.get_mut(&node) { + if let Some(visits_for_node) = self.visits.get_mut(node) { // Identify the walks that start from the given node (i.e., position is 0) let walkids_to_remove: Vec = visits_for_node .iter() @@ -118,7 +124,7 @@ impl WalkStorage { if let Some(walk_to_remove) = self.walks.get(walk_id) { // Iterate over the nodes in the walk and remove the walk_id from their visits for node in walk_to_remove.iter() { - if let Some(visits) = self.visits.get_mut(node) { + if let Some(visits) = self.visits.get_mut(*node) { visits.remove(&walk_id); } } @@ -126,8 +132,6 @@ impl WalkStorage { self.unused_walks.push_back(walk_id); self.walks.get_mut(walk_id).unwrap().clear(); } - // Remove any empty entries from the visits HashMap - self.visits.retain(|_, visits_ref| !visits_ref.is_empty()); } } @@ -137,9 +141,9 @@ impl WalkStorage { pub fn assert_visits_consistency(&self) { - for (node, visits) in self.visits.iter(){ + for (node, visits) in self.visits.iter().enumerate(){ for (walkid,pos) in visits.iter(){ - assert_eq!(self.walks[*walkid].nodes[*pos], *node); + assert_eq!(self.walks[*walkid].nodes[*pos], node); } } @@ -195,7 +199,7 @@ impl WalkStorage { let mut invalidated_walks_ids = vec![]; // Check if there are any walks passing through the invalidated node - let walks= match self.visits.get(&invalidated_node) { + let walks= match self.visits.get(invalidated_node) { Some(walks) => walks, None => return invalidated_walks_ids, }; @@ -238,7 +242,7 @@ impl WalkStorage { .iter() .filter(|&node| !walk.contains(node)) { - if let Some(affected_walks) = self.visits.get_mut(&affected_node) { + if let Some(affected_walks) = self.visits.get_mut(affected_node) { if affected_walks.get(walk_id).is_some() { // Remove the invalidated walk from affected nodes affected_walks.remove(walk_id); diff --git a/tests/test_walkstorage.rs b/tests/test_walkstorage.rs index 4be58c1..5690025 100644 --- a/tests/test_walkstorage.rs +++ b/tests/test_walkstorage.rs @@ -1,8 +1,10 @@ #[allow(unused_imports)] #[cfg(test)] mod tests { + use std::collections::HashMap; use super::*; - use indexmap::indexmap; + use indexmap::{indexmap, IndexMap}; + use integer_hasher::IntMap; use meritrank::graph::{NodeId, EdgeId}; use meritrank::random_walk::RandomWalk; use meritrank::walk_storage::{decide_skip_invalidation, decide_skip_invalidation_on_edge_addition, decide_skip_invalidation_on_edge_deletion, WalkStorage}; @@ -33,32 +35,28 @@ mod tests { let walk_storage_str = format!("{:?}", walk_storage); let expected_visits_str = format!( "WalkStorage {{ walks: {:?} }}", - indexmap! { - 2 => indexmap! { - walkid3 => 0, + vec![ + IndexMap::default(), + IndexMap::default(), + indexmap! { + walkid3 => 0, }, - 3 => indexmap! { - walkid3 => 1, + indexmap! { + walkid3 => 1, }, - 4 => indexmap! { - walkid3 => 2, + indexmap! { + walkid3 => 2, }, - } + IndexMap::default(), + ] ); assert_eq!(walk_storage_str, expected_visits_str); - assert_eq!(walk_storage.get_walks().len(), 3); - assert_eq!( - walk_storage - .get_walks() - .get(&1) - .map(|m| format!("{:?}", m)), - None.map(|()| "".to_string()) - ); - assert_eq!(walk_storage.get_walks()[&2].len(), 1); - assert_eq!(walk_storage.get_walks()[&3].len(), 1); - assert_eq!(walk_storage.get_walks()[&4].len(), 1); + assert_eq!(walk_storage.get_walks().len(), 6); + assert_eq!(walk_storage.get_walks()[2].len(), 1); + assert_eq!(walk_storage.get_walks()[3].len(), 1); + assert_eq!(walk_storage.get_walks()[4].len(), 1); // Make sure that the walks are reused assert_eq!(walk_storage.get_next_free_walkid(), 0); From 9bf21bf18130e4e7cc9043d1b72f0f3f712263ba Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Thu, 18 Jul 2024 18:31:40 +0200 Subject: [PATCH 09/12] Add caching WeightedIndex sampling --- bench/test_smoke.rs | 3867 +++++++++++++++++++++++++++++++++++++++++++ src/constants.rs | 2 +- src/graph.rs | 37 +- src/rank.rs | 45 +- 4 files changed, 3914 insertions(+), 37 deletions(-) create mode 100644 bench/test_smoke.rs diff --git a/bench/test_smoke.rs b/bench/test_smoke.rs new file mode 100644 index 0000000..519c1b5 --- /dev/null +++ b/bench/test_smoke.rs @@ -0,0 +1,3867 @@ +#[cfg(test)] +mod tests { + use meritrank::{MeritRank, Graph}; + use std::time::SystemTime; + + #[test] + fn smoke_perf() { + let mut rank = MeritRank::new(Graph::new()).unwrap(); + + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(0, 1, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(4, 5, 9.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(6, 7, 7.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(9, 10, 3.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(13, 14, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(16, 17, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(19, 20, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(21, 22, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(23, 24, 0.0); + rank.get_new_nodeid(); + rank.add_edge(9, 25, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(26, 27, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(30, 22, 4.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(31, 32, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(13, 34, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 35, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(36, 37, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(38, 39, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(42, 1, 6.0); + rank.add_edge(35, 14, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(45, 46, -2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(48, 49, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(50, 51, 5.0); + rank.add_edge(24, 27, 1.0); + rank.add_edge(31, 27, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(53, 54, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(59, 60, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(61, 62, 1.0); + rank.get_new_nodeid(); + rank.add_edge(63, 24, -2.0); + rank.get_new_nodeid(); + rank.add_edge(64, 0, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(65, 66, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(68, 7, 2.0); + rank.get_new_nodeid(); + rank.add_edge(30, 49, 6.0); + rank.get_new_nodeid(); + rank.add_edge(70, 22, 3.0); + rank.get_new_nodeid(); + rank.add_edge(53, 71, 1.0); + rank.get_new_nodeid(); + rank.add_edge(72, 48, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(73, 74, 1.0); + rank.add_edge(21, 6, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(75, 76, 1.0); + rank.add_edge(70, 14, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(78, 24, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(9, 81, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(82, 83, 1.0); + rank.get_new_nodeid(); + rank.add_edge(84, 51, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(85, 86, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(88, 48, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(89, 90, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(92, 93, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(94, 95, -1.0); + rank.get_new_nodeid(); + rank.add_edge(93, 96, 1.0); + rank.get_new_nodeid(); + rank.add_edge(97, 88, 8.0); + rank.get_new_nodeid(); + rank.add_edge(13, 98, -1.0); + rank.add_edge(31, 42, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 51, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 100, -1.0); + rank.add_edge(68, 96, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(102, 103, 1.0); + rank.get_new_nodeid(); + rank.add_edge(104, 76, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(105, 106, 1.0); + rank.get_new_nodeid(); + rank.add_edge(107, 72, 0.0); + rank.get_new_nodeid(); + rank.add_edge(108, 1, 14.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(109, 110, 1.0); + rank.get_new_nodeid(); + rank.add_edge(50, 111, 6.0); + rank.get_new_nodeid(); + rank.add_edge(112, 76, 1.0); + rank.get_new_nodeid(); + rank.add_edge(113, 27, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(114, 115, 4.0); + rank.get_new_nodeid(); + rank.add_edge(110, 116, 1.0); + rank.add_edge(9, 32, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(117, 118, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(119, 120, 1.0); + rank.get_new_nodeid(); + rank.add_edge(59, 121, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(123, 105, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(124, 125, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 126, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(85, 128, 1.0); + rank.get_new_nodeid(); + rank.add_edge(104, 129, 1.0); + rank.add_edge(27, 26, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(114, 131, 2.0); + rank.get_new_nodeid(); + rank.add_edge(132, 1, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 125, 1.0); + rank.get_new_nodeid(); + rank.add_edge(82, 134, 1.0); + rank.get_new_nodeid(); + rank.add_edge(135, 56, 1.0); + rank.add_edge(84, 88, 9.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(21, 137, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(9, 139, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(140, 141, 1.0); + rank.get_new_nodeid(); + rank.add_edge(142, 25, 1.0); + rank.add_edge(9, 98, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(145, 146, 8.0); + rank.get_new_nodeid(); + rank.add_edge(97, 147, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(148, 149, 1.0); + rank.add_edge(9, 24, 3.0); + rank.get_new_nodeid(); + rank.add_edge(150, 46, 2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(151, 152, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(153, 154, 3.0); + rank.add_edge(13, 46, 1.0); + rank.get_new_nodeid(); + rank.add_edge(155, 31, 1.0); + rank.add_edge(69, 14, 2.0); + rank.add_edge(4, 76, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 156, -1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 157, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(158, 159, 1.0); + rank.add_edge(69, 129, 2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(27, 161, 1.0); + rank.get_new_nodeid(); + rank.add_edge(162, 76, -1.0); + rank.get_new_nodeid(); + rank.add_edge(19, 81, 1.0); + rank.get_new_nodeid(); + rank.add_edge(147, 97, 1.0); + rank.get_new_nodeid(); + rank.add_edge(124, 165, 1.0); + rank.add_edge(161, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 54, 3.0); + rank.add_edge(65, 24, 2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(107, 168, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(27, 170, 1.0); + rank.add_edge(149, 24, 5.0); + rank.get_new_nodeid(); + rank.add_edge(70, 171, 1.0); + rank.add_edge(110, 72, -1.0); + rank.get_new_nodeid(); + rank.add_edge(172, 69, 1.0); + rank.get_new_nodeid(); + rank.add_edge(113, 173, -11.0); + rank.add_edge(104, 75, 4.0); + rank.add_edge(125, 9, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 174, 1.0); + rank.add_edge(0, 10, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 175, -1.0); + rank.get_new_nodeid(); + rank.add_edge(176, 35, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(180, 95, 3.0); + rank.add_edge(69, 12, 1.0); + rank.add_edge(13, 9, 1.0); + rank.add_edge(146, 4, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(181, 182, 1.0); + rank.add_edge(0, 24, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(183, 184, 1.0); + rank.get_new_nodeid(); + rank.add_edge(185, 13, 1.0); + rank.add_edge(9, 46, 3.0); + rank.add_edge(48, 162, 1.0); + rank.add_edge(31, 13, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(186, 187, 1.0); + rank.get_new_nodeid(); + rank.add_edge(4, 14, 9.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(190, 191, -1.0); + rank.add_edge(116, 110, 1.0); + rank.get_new_nodeid(); + rank.add_edge(192, 24, -1.0); + rank.add_edge(47, 175, 3.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(50, 194, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 35, 1.0); + rank.add_edge(145, 191, 3.0); + rank.add_edge(31, 9, 1.0); + rank.add_edge(31, 51, -1.0); + rank.add_edge(19, 154, 6.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(76, 114, -1.0); + rank.add_edge(35, 81, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(48, 22, 5.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(4, 202, 4.0); + rank.add_edge(31, 34, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(9, 204, -1.0); + rank.add_edge(19, 49, 1.0); + rank.get_new_nodeid(); + rank.add_edge(205, 35, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 206, 1.0); + rank.add_edge(83, 13, 1.0); + rank.add_edge(110, 13, 1.0); + rank.add_edge(82, 46, 1.0); + rank.add_edge(114, 168, -1.0); + rank.add_edge(12, 173, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(9, 208, 3.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(209, 210, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(113, 212, 1.0); + rank.get_new_nodeid(); + rank.add_edge(76, 213, 1.0); + rank.add_edge(31, 185, 1.0); + rank.add_edge(6, 70, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(215, 205, 5.0); + rank.get_new_nodeid(); + rank.add_edge(216, 31, 1.0); + rank.add_edge(153, 114, 1.0); + rank.get_new_nodeid(); + rank.add_edge(183, 1, 3.0); + rank.get_new_nodeid(); + rank.add_edge(110, 175, -9.0); + rank.get_new_nodeid(); + rank.add_edge(132, 7, -1.0); + rank.get_new_nodeid(); + rank.add_edge(220, 151, 1.0); + rank.add_edge(124, 205, 1.0); + rank.add_edge(103, 102, 1.0); + rank.get_new_nodeid(); + rank.add_edge(215, 35, 1.0); + rank.add_edge(108, 115, -4.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(50, 223, 3.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(225, 77, 1.0); + rank.get_new_nodeid(); + rank.add_edge(39, 75, 2.0); + rank.add_edge(104, 153, -1.0); + rank.add_edge(145, 75, -1.0); + rank.add_edge(82, 165, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 227, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 228, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(229, 230, 1.0); + rank.get_new_nodeid(); + rank.add_edge(231, 150, 1.0); + rank.get_new_nodeid(); + rank.add_edge(113, 18, 1.0); + rank.get_new_nodeid(); + rank.add_edge(233, 9, 1.0); + rank.add_edge(210, 24, -2.0); + rank.add_edge(31, 191, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 26, 2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(236, 107, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 237, 1.0); + rank.add_edge(98, 215, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(239, 46, 4.0); + rank.add_edge(100, 19, 1.0); + rank.get_new_nodeid(); + rank.add_edge(6, 240, 1.0); + rank.add_edge(108, 72, -8.0); + rank.add_edge(9, 175, -1.0); + rank.get_new_nodeid(); + rank.add_edge(241, 39, 1.0); + rank.add_edge(230, 1, -2.0); + rank.add_edge(82, 237, 1.0); + rank.get_new_nodeid(); + rank.add_edge(242, 53, 1.0); + rank.get_new_nodeid(); + rank.add_edge(243, 186, 1.0); + rank.get_new_nodeid(); + rank.add_edge(114, 244, 2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(30, 246, 5.0); + rank.add_edge(19, 244, 1.0); + rank.add_edge(39, 49, 4.0); + rank.get_new_nodeid(); + rank.add_edge(247, 77, 1.0); + rank.add_edge(20, 19, 1.0); + rank.add_edge(4, 213, 8.0); + rank.add_edge(30, 240, 3.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(249, 12, 1.0); + rank.add_edge(13, 83, 1.0); + rank.add_edge(121, 59, 1.0); + rank.get_new_nodeid(); + rank.add_edge(250, 153, 1.0); + rank.add_edge(13, 109, -1.0); + rank.add_edge(150, 24, 4.0); + rank.add_edge(113, 24, 10.0); + rank.add_edge(227, 35, 1.0); + rank.add_edge(151, 7, 0.0); + rank.add_edge(6, 111, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 251, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 252, 3.0); + rank.get_new_nodeid(); + rank.add_edge(4, 246, 4.0); + rank.get_new_nodeid(); + rank.add_edge(145, 254, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(255, 256, 1.0); + rank.add_edge(18, 139, 1.0); + rank.add_edge(21, 22, 5.0); + rank.get_new_nodeid(); + rank.add_edge(9, 257, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 258, 1.0); + rank.add_edge(150, 172, -5.0); + rank.add_edge(159, 24, -1.0); + rank.get_new_nodeid(); + rank.add_edge(259, 24, -1.0); + rank.add_edge(35, 1, -1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 260, 1.0); + rank.get_new_nodeid(); + rank.add_edge(21, 261, 9.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(263, 1, 1.0); + rank.get_new_nodeid(); + rank.add_edge(85, 264, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(266, 90, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 165, 1.0); + rank.get_new_nodeid(); + rank.add_edge(93, 268, 1.0); + rank.add_edge(48, 129, -1.0); + rank.get_new_nodeid(); + rank.add_edge(269, 93, 1.0); + rank.add_edge(107, 236, 1.0); + rank.add_edge(129, 104, 1.0); + rank.add_edge(175, 39, 1.0); + rank.get_new_nodeid(); + rank.add_edge(270, 73, -7.0); + rank.add_edge(63, 72, 2.0); + rank.add_edge(32, 9, 1.0); + rank.add_edge(104, 194, 5.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(271, 272, 1.0); + rank.add_edge(246, 76, 1.0); + rank.add_edge(31, 155, 1.0); + rank.add_edge(21, 20, 2.0); + rank.get_new_nodeid(); + rank.add_edge(31, 14, -1.0); + rank.get_new_nodeid(); + rank.add_edge(274, 84, 1.0); + rank.add_edge(48, 72, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 100, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(277, 44, 1.0); + rank.get_new_nodeid(); + rank.add_edge(69, 278, 4.0); + rank.get_new_nodeid(); + rank.add_edge(279, 45, 1.0); + rank.add_edge(162, 75, 7.0); + rank.add_edge(6, 69, 1.0); + rank.get_new_nodeid(); + rank.add_edge(255, 257, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(82, 185, 1.0); + rank.get_new_nodeid(); + rank.add_edge(45, 279, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(27, 286, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(289, 24, 1.0); + rank.get_new_nodeid(); + rank.add_edge(21, 290, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(27, 292, 1.0); + rank.add_edge(115, 12, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(9, 294, 1.0); + rank.add_edge(13, 204, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(13, 296, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(298, 110, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 165, 1.0); + rank.add_edge(113, 17, 3.0); + rank.add_edge(151, 220, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 191, -1.0); + rank.add_edge(16, 24, 2.0); + rank.get_new_nodeid(); + rank.add_edge(301, 159, 1.0); + rank.add_edge(124, 25, 1.0); + rank.get_new_nodeid(); + rank.add_edge(302, 159, 1.0); + rank.add_edge(39, 72, 7.0); + rank.get_new_nodeid(); + rank.add_edge(84, 147, -1.0); + rank.add_edge(9, 14, -1.0); + rank.get_new_nodeid(); + rank.add_edge(304, 257, 1.0); + rank.add_edge(50, 173, 9.0); + rank.add_edge(141, 24, 2.0); + rank.add_edge(35, 205, 1.0); + rank.get_new_nodeid(); + rank.add_edge(163, 305, 1.0); + rank.add_edge(244, 19, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(306, 307, 1.0); + rank.add_edge(290, 21, 1.0); + rank.add_edge(27, 252, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 308, 1.0); + rank.add_edge(25, 142, 1.0); + rank.get_new_nodeid(); + rank.add_edge(53, 309, -18.0); + rank.get_new_nodeid(); + rank.add_edge(280, 310, 1.0); + rank.get_new_nodeid(); + rank.add_edge(311, 27, 1.0); + rank.add_edge(62, 61, 1.0); + rank.add_edge(30, 7, 2.0); + rank.get_new_nodeid(); + rank.add_edge(104, 154, 5.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(79, 316, 1.0); + rank.get_new_nodeid(); + rank.add_edge(110, 317, 5.0); + rank.add_edge(141, 140, 1.0); + rank.add_edge(35, 24, 4.0); + rank.add_edge(76, 246, 1.0); + rank.get_new_nodeid(); + rank.add_edge(296, 13, 1.0); + rank.add_edge(18, 46, 7.0); + rank.get_new_nodeid(); + rank.add_edge(6, 131, 4.0); + rank.get_new_nodeid(); + rank.add_edge(9, 320, -1.0); + rank.get_new_nodeid(); + rank.add_edge(260, 53, 1.0); + rank.add_edge(47, 14, -1.0); + rank.add_edge(305, 163, 1.0); + rank.add_edge(82, 205, 1.0); + rank.add_edge(163, 72, 0.0); + rank.get_new_nodeid(); + rank.add_edge(322, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(110, 109, 1.0); + rank.get_new_nodeid(); + rank.add_edge(0, 324, 1.0); + rank.add_edge(35, 72, -1.0); + rank.add_edge(71, 53, 1.0); + rank.get_new_nodeid(); + rank.add_edge(183, 241, -3.0); + rank.add_edge(208, 27, 1.0); + rank.add_edge(204, 97, 1.0); + rank.add_edge(81, 19, 1.0); + rank.get_new_nodeid(); + rank.add_edge(4, 326, 6.0); + rank.get_new_nodeid(); + rank.add_edge(9, 156, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 328, 1.0); + rank.get_new_nodeid(); + rank.add_edge(329, 275, 1.0); + rank.add_edge(120, 237, 1.0); + rank.get_new_nodeid(); + rank.add_edge(275, 24, -4.0); + rank.add_edge(221, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 331, 1.0); + rank.get_new_nodeid(); + rank.add_edge(12, 249, 1.0); + rank.get_new_nodeid(); + rank.add_edge(113, 156, -3.0); + rank.get_new_nodeid(); + rank.add_edge(0, 64, 1.0); + rank.add_edge(110, 185, 3.0); + rank.get_new_nodeid(); + rank.add_edge(70, 7, 3.0); + rank.add_edge(39, 38, 1.0); + rank.add_edge(13, 81, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(336, 337, 1.0); + rank.add_edge(21, 1, 1.0); + rank.add_edge(190, 24, 2.0); + rank.get_new_nodeid(); + rank.add_edge(338, 221, 1.0); + rank.add_edge(31, 172, -1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 339, 1.0); + rank.add_edge(294, 9, 1.0); + rank.get_new_nodeid(); + rank.add_edge(340, 97, 1.0); + rank.add_edge(213, 76, 1.0); + rank.add_edge(49, 19, 1.0); + rank.add_edge(69, 326, 1.0); + rank.add_edge(82, 64, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 341, 1.0); + rank.add_edge(48, 131, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 249, -1.0); + rank.get_new_nodeid(); + rank.add_edge(114, 88, 7.0); + rank.add_edge(31, 72, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(345, 230, 1.0); + rank.add_edge(18, 7, -5.0); + rank.add_edge(110, 32, 3.0); + rank.get_new_nodeid(); + rank.add_edge(48, 70, 1.0); + rank.get_new_nodeid(); + rank.add_edge(347, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(134, 42, 1.0); + rank.add_edge(215, 98, 1.0); + rank.get_new_nodeid(); + rank.add_edge(255, 304, 4.0); + rank.add_edge(76, 47, -1.0); + rank.add_edge(35, 6, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(101, 354, 1.0); + rank.get_new_nodeid(); + rank.add_edge(30, 47, 1.0); + rank.add_edge(12, 261, -1.0); + rank.add_edge(70, 223, 5.0); + rank.add_edge(31, 119, 1.0); + rank.add_edge(264, 85, 1.0); + rank.add_edge(230, 241, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(357, 44, 1.0); + rank.add_edge(240, 48, 1.0); + rank.get_new_nodeid(); + rank.add_edge(12, 22, -1.0); + rank.get_new_nodeid(); + rank.add_edge(359, 31, 1.0); + rank.add_edge(95, 284, 1.0); + rank.add_edge(239, 172, 2.0); + rank.get_new_nodeid(); + rank.add_edge(149, 32, 5.0); + rank.add_edge(86, 85, 1.0); + rank.add_edge(31, 216, 1.0); + rank.add_edge(21, 191, 1.0); + rank.add_edge(272, 271, 1.0); + rank.get_new_nodeid(); + rank.add_edge(361, 93, 1.0); + rank.get_new_nodeid(); + rank.add_edge(0, 157, 1.0); + rank.add_edge(35, 204, -1.0); + rank.add_edge(69, 172, 1.0); + rank.get_new_nodeid(); + rank.add_edge(363, 259, 1.0); + rank.add_edge(257, 304, 1.0); + rank.add_edge(9, 213, 1.0); + rank.add_edge(50, 129, 8.0); + rank.add_edge(104, 69, 1.0); + rank.add_edge(181, 24, 2.0); + rank.add_edge(113, 46, 1.0); + rank.get_new_nodeid(); + rank.add_edge(364, 35, 1.0); + rank.add_edge(31, 64, 1.0); + rank.get_new_nodeid(); + rank.add_edge(162, 30, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 228, 1.0); + rank.add_edge(62, 24, 2.0); + rank.add_edge(110, 24, 9.0); + rank.get_new_nodeid(); + rank.add_edge(68, 46, 5.0); + rank.add_edge(37, 36, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(97, 369, 9.0); + rank.get_new_nodeid(); + rank.add_edge(60, 59, 1.0); + rank.add_edge(113, 191, -3.0); + rank.add_edge(50, 278, 1.0); + rank.get_new_nodeid(); + rank.add_edge(107, 24, -1.0); + rank.add_edge(145, 70, -1.0); + rank.add_edge(35, 252, 4.0); + rank.add_edge(48, 5, 1.0); + rank.get_new_nodeid(); + rank.add_edge(372, 18, 1.0); + rank.add_edge(76, 38, 2.0); + rank.add_edge(259, 168, -1.0); + rank.get_new_nodeid(); + rank.add_edge(373, 9, 1.0); + rank.get_new_nodeid(); + rank.add_edge(50, 374, -1.0); + rank.add_edge(110, 83, 2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(153, 376, 1.0); + rank.get_new_nodeid(); + rank.add_edge(124, 377, 1.0); + rank.add_edge(239, 187, 3.0); + rank.add_edge(9, 260, 3.0); + rank.get_new_nodeid(); + rank.add_edge(12, 21, 1.0); + rank.add_edge(118, 117, 1.0); + rank.get_new_nodeid(); + rank.add_edge(261, 153, 1.0); + rank.add_edge(21, 202, 6.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(174, 120, 1.0); + rank.add_edge(93, 46, 3.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(114, 383, 1.0); + rank.add_edge(149, 317, 1.0); + rank.add_edge(194, 50, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(286, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(107, 387, 1.0); + rank.add_edge(6, 4, 1.0); + rank.add_edge(237, 120, 1.0); + rank.add_edge(46, 113, 1.0); + rank.add_edge(376, 153, 1.0); + rank.add_edge(47, 173, 1.0); + rank.add_edge(13, 320, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(389, 59, 1.0); + rank.add_edge(97, 204, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 172, -1.0); + rank.get_new_nodeid(); + rank.add_edge(391, 62, 1.0); + rank.add_edge(21, 72, 5.0); + rank.add_edge(9, 6, 1.0); + rank.add_edge(50, 223, 1.0); + rank.add_edge(97, 115, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 84, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 103, -1.0); + rank.add_edge(14, 70, 1.0); + rank.get_new_nodeid(); + rank.add_edge(4, 394, 8.0); + rank.add_edge(9, 237, 3.0); + rank.add_edge(257, 24, -4.0); + rank.get_new_nodeid(); + rank.add_edge(53, 395, 1.0); + rank.add_edge(63, 241, 1.0); + rank.add_edge(13, 0, 1.0); + rank.add_edge(44, 357, 1.0); + rank.get_new_nodeid(); + rank.add_edge(396, 336, 1.0); + rank.add_edge(184, 183, 1.0); + rank.add_edge(31, 134, 3.0); + rank.add_edge(108, 51, 3.0); + rank.add_edge(113, 139, 3.0); + rank.get_new_nodeid(); + rank.add_edge(154, 97, 1.0); + rank.get_new_nodeid(); + rank.add_edge(270, 398, 1.0); + rank.add_edge(13, 191, -1.0); + rank.get_new_nodeid(); + rank.add_edge(399, 65, 1.0); + rank.add_edge(50, 131, 9.0); + rank.add_edge(104, 112, 3.0); + rank.add_edge(13, 383, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(401, 53, 1.0); + rank.add_edge(31, 175, -1.0); + rank.add_edge(113, 208, -1.0); + rank.add_edge(53, 242, 1.0); + rank.add_edge(128, 85, 1.0); + rank.get_new_nodeid(); + rank.add_edge(104, 47, -1.0); + rank.get_new_nodeid(); + rank.add_edge(110, 298, 1.0); + rank.add_edge(97, 340, 3.0); + rank.get_new_nodeid(); + rank.add_edge(9, 142, 1.0); + rank.get_new_nodeid(); + rank.add_edge(336, 405, 1.0); + rank.add_edge(94, 398, 1.0); + rank.add_edge(124, 35, 0.0); + rank.add_edge(68, 320, 1.0); + rank.add_edge(377, 124, 1.0); + rank.add_edge(56, 135, 1.0); + rank.add_edge(76, 112, 1.0); + rank.add_edge(42, 175, 5.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(13, 165, 1.0); + rank.add_edge(9, 103, -1.0); + rank.get_new_nodeid(); + rank.add_edge(93, 408, 1.0); + rank.get_new_nodeid(); + rank.add_edge(409, 59, 1.0); + rank.get_new_nodeid(); + rank.add_edge(206, 27, 1.0); + rank.add_edge(70, 250, -1.0); + rank.add_edge(35, 161, 2.0); + rank.add_edge(31, 83, 1.0); + rank.get_new_nodeid(); + rank.add_edge(21, 394, 1.0); + rank.add_edge(150, 231, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(21, 51, 1.0); + rank.add_edge(50, 246, 3.0); + rank.add_edge(239, 139, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 24, 1.0); + rank.add_edge(21, 191, 9.0); + rank.add_edge(107, 175, -1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 251, -1.0); + rank.add_edge(48, 240, 1.0); + rank.add_edge(39, 112, 8.0); + rank.get_new_nodeid(); + rank.add_edge(66, 65, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 115, -1.0); + rank.add_edge(27, 35, 1.0); + rank.add_edge(42, 72, 4.0); + rank.get_new_nodeid(); + rank.add_edge(307, 306, 1.0); + rank.add_edge(35, 173, -1.0); + rank.add_edge(4, 191, 6.0); + rank.add_edge(9, 383, -1.0); + rank.add_edge(145, 168, 1.0); + rank.add_edge(110, 115, -1.0); + rank.add_edge(4, 145, 1.0); + rank.get_new_nodeid(); + rank.add_edge(104, 50, 1.0); + rank.add_edge(31, 54, 1.0); + rank.add_edge(44, 277, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(272, 252, 3.0); + rank.add_edge(70, 5, 2.0); + rank.add_edge(35, 308, 1.0); + rank.add_edge(343, 24, 0.0); + rank.add_edge(328, 9, 1.0); + rank.get_new_nodeid(); + rank.add_edge(0, 46, 1.0); + rank.add_edge(104, 374, 5.0); + rank.add_edge(90, 24, 0.0); + rank.add_edge(59, 389, 1.0); + rank.get_new_nodeid(); + rank.add_edge(212, 113, 1.0); + rank.add_edge(13, 173, -1.0); + rank.get_new_nodeid(); + rank.add_edge(30, 331, 1.0); + rank.add_edge(27, 309, 1.0); + rank.get_new_nodeid(); + rank.add_edge(30, 75, 3.0); + rank.add_edge(97, 1, 7.0); + rank.add_edge(84, 7, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(27, 428, 1.0); + rank.add_edge(1, 21, 1.0); + rank.add_edge(76, 75, 1.0); + rank.add_edge(309, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 115, -1.0); + rank.add_edge(18, 372, 1.0); + rank.add_edge(394, 21, 1.0); + rank.add_edge(259, 363, 1.0); + rank.add_edge(221, 338, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 341, 1.0); + rank.add_edge(162, 14, 2.0); + rank.get_new_nodeid(); + rank.add_edge(70, 48, 1.0); + rank.add_edge(97, 154, 1.0); + rank.add_edge(21, 340, 9.0); + rank.add_edge(9, 173, -1.0); + rank.add_edge(35, 100, -1.0); + rank.add_edge(162, 374, 6.0); + rank.add_edge(324, 113, 1.0); + rank.add_edge(182, 181, 1.0); + rank.add_edge(251, 48, 1.0); + rank.add_edge(5, 48, 1.0); + rank.add_edge(326, 69, 1.0); + rank.add_edge(316, 79, 1.0); + rank.add_edge(162, 115, 3.0); + rank.add_edge(162, 278, 1.0); + rank.get_new_nodeid(); + rank.add_edge(30, 432, 1.0); + rank.add_edge(84, 274, 1.0); + rank.get_new_nodeid(); + rank.add_edge(47, 6, 1.0); + rank.add_edge(68, 24, 3.0); + rank.add_edge(191, 21, 1.0); + rank.add_edge(105, 24, 0.0); + rank.get_new_nodeid(); + rank.add_edge(4, 202, 1.0); + rank.add_edge(19, 111, -1.0); + rank.add_edge(31, 113, 1.0); + rank.get_new_nodeid(); + rank.add_edge(230, 229, 1.0); + rank.add_edge(341, 27, 1.0); + rank.add_edge(42, 134, 1.0); + rank.add_edge(258, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(221, 436, 1.0); + rank.add_edge(93, 361, 1.0); + rank.add_edge(9, 174, 3.0); + rank.add_edge(62, 391, 1.0); + rank.add_edge(19, 278, 4.0); + rank.add_edge(35, 7, -1.0); + rank.get_new_nodeid(); + rank.add_edge(45, 437, 1.0); + rank.get_new_nodeid(); + rank.add_edge(438, 289, 1.0); + rank.get_new_nodeid(); + rank.add_edge(54, 53, 1.0); + rank.get_new_nodeid(); + rank.add_edge(107, 1, 1.0); + rank.add_edge(39, 241, 1.0); + rank.add_edge(374, 145, 1.0); + rank.add_edge(13, 7, -1.0); + rank.add_edge(31, 204, -1.0); + rank.add_edge(12, 146, 8.0); + rank.add_edge(113, 172, 8.0); + rank.add_edge(149, 46, 5.0); + rank.add_edge(31, 304, 1.0); + rank.add_edge(120, 119, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 359, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(30, 21, 1.0); + rank.add_edge(145, 374, 1.0); + rank.add_edge(13, 185, 1.0); + rank.add_edge(139, 18, 1.0); + rank.add_edge(310, 280, 1.0); + rank.add_edge(339, 27, 1.0); + rank.add_edge(4, 154, 4.0); + rank.get_new_nodeid(); + rank.add_edge(48, 445, 1.0); + rank.add_edge(408, 93, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(111, 6, 1.0); + rank.add_edge(48, 326, 4.0); + rank.add_edge(239, 176, 3.0); + rank.get_new_nodeid(); + rank.add_edge(35, 449, 1.0); + rank.add_edge(331, 30, 1.0); + rank.add_edge(13, 156, -1.0); + rank.add_edge(156, 6, 1.0); + rank.add_edge(145, 251, 8.0); + rank.add_edge(110, 252, 5.0); + rank.add_edge(13, 24, 2.0); + rank.add_edge(63, 1, 1.0); + rank.get_new_nodeid(); + rank.add_edge(450, 90, 1.0); + rank.get_new_nodeid(); + rank.add_edge(360, 42, 1.0); + rank.add_edge(59, 24, 1.0); + rank.add_edge(13, 208, 2.0); + rank.add_edge(82, 32, 1.0); + rank.get_new_nodeid(); + rank.add_edge(105, 452, 1.0); + rank.add_edge(163, 251, 1.0); + rank.add_edge(428, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(275, 453, 1.0); + rank.add_edge(278, 162, 1.0); + rank.add_edge(9, 1, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(455, 280, 1.0); + rank.add_edge(35, 339, 1.0); + rank.add_edge(432, 30, 1.0); + rank.add_edge(288, 24, 1.0); + rank.add_edge(252, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(456, 46, 4.0); + rank.get_new_nodeid(); + rank.add_edge(153, 261, 1.0); + rank.add_edge(255, 46, 2.0); + rank.get_new_nodeid(); + rank.add_edge(141, 458, 1.0); + rank.add_edge(35, 176, 1.0); + rank.add_edge(162, 261, 8.0); + rank.add_edge(31, 139, 1.0); + rank.add_edge(9, 113, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(306, 461, 1.0); + rank.add_edge(63, 168, 0.0); + rank.get_new_nodeid(); + rank.add_edge(186, 462, 1.0); + rank.add_edge(308, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(47, 20, 3.0); + rank.add_edge(76, 137, 8.0); + rank.get_new_nodeid(); + rank.add_edge(153, 115, 2.0); + rank.add_edge(31, 173, -1.0); + rank.add_edge(9, 246, 1.0); + rank.add_edge(31, 0, 1.0); + rank.add_edge(142, 205, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 115, -1.0); + rank.add_edge(13, 35, 1.0); + rank.add_edge(84, 331, 3.0); + rank.add_edge(13, 231, -1.0); + rank.get_new_nodeid(); + rank.add_edge(452, 105, 1.0); + rank.get_new_nodeid(); + rank.add_edge(356, 7, -3.0); + rank.get_new_nodeid(); + rank.add_edge(69, 468, 1.0); + rank.add_edge(82, 208, 1.0); + rank.add_edge(42, 24, -6.0); + rank.get_new_nodeid(); + rank.add_edge(159, 158, 1.0); + rank.add_edge(19, 250, 4.0); + rank.add_edge(6, 84, 1.0); + rank.get_new_nodeid(); + rank.add_edge(470, 93, 1.0); + rank.add_edge(35, 172, -1.0); + rank.add_edge(9, 205, 4.0); + rank.get_new_nodeid(); + rank.add_edge(27, 208, 1.0); + rank.add_edge(102, 9, 1.0); + rank.add_edge(239, 34, 2.0); + rank.get_new_nodeid(); + rank.add_edge(102, 32, 4.0); + rank.add_edge(31, 24, 1.0); + rank.add_edge(284, 95, 1.0); + rank.add_edge(9, 286, 1.0); + rank.add_edge(320, 68, 1.0); + rank.add_edge(77, 225, 1.0); + rank.get_new_nodeid(); + rank.add_edge(19, 1, 8.0); + rank.add_edge(275, 329, 1.0); + rank.add_edge(39, 175, 1.0); + rank.get_new_nodeid(); + rank.add_edge(474, 24, 6.0); + rank.add_edge(398, 270, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(27, 347, 1.0); + rank.get_new_nodeid(); + rank.add_edge(387, 107, 1.0); + rank.add_edge(395, 53, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(6, 35, 1.0); + rank.add_edge(13, 251, -1.0); + rank.add_edge(165, 35, 1.0); + rank.add_edge(159, 301, 1.0); + rank.add_edge(280, 455, 1.0); + rank.add_edge(9, 149, 1.0); + rank.add_edge(461, 306, 1.0); + rank.add_edge(35, 208, 3.0); + rank.add_edge(21, 369, 1.0); + rank.get_new_nodeid(); + rank.add_edge(59, 409, 1.0); + rank.add_edge(21, 35, 1.0); + rank.add_edge(65, 399, 1.0); + rank.get_new_nodeid(); + rank.add_edge(257, 46, 4.0); + rank.add_edge(256, 255, 1.0); + rank.add_edge(458, 141, 1.0); + rank.add_edge(239, 24, 2.0); + rank.add_edge(354, 101, 1.0); + rank.add_edge(436, 221, 1.0); + rank.get_new_nodeid(); + rank.add_edge(113, 34, 5.0); + rank.add_edge(9, 51, -1.0); + rank.add_edge(35, 286, 2.0); + rank.get_new_nodeid(); + rank.add_edge(405, 336, 1.0); + rank.add_edge(90, 450, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(97, 35, 1.0); + rank.add_edge(19, 100, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 486, 1.0); + rank.add_edge(153, 250, 1.0); + rank.add_edge(35, 51, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(7, 84, 1.0); + rank.add_edge(9, 304, 3.0); + rank.add_edge(48, 88, 1.0); + rank.add_edge(163, 241, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 373, 1.0); + rank.add_edge(202, 4, 1.0); + rank.add_edge(50, 369, 7.0); + rank.add_edge(153, 1, 9.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(9, 72, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(108, 7, -4.0); + rank.add_edge(48, 376, 5.0); + rank.get_new_nodeid(); + rank.add_edge(145, 21, 1.0); + rank.add_edge(168, 145, 1.0); + rank.add_edge(4, 75, -1.0); + rank.add_edge(82, 304, 1.0); + rank.add_edge(289, 438, 1.0); + rank.add_edge(93, 470, 1.0); + rank.add_edge(13, 205, 1.0); + rank.add_edge(30, 146, 6.0); + rank.add_edge(186, 17, 1.0); + rank.add_edge(84, 223, 5.0); + rank.add_edge(76, 7, 9.0); + rank.add_edge(4, 146, 1.0); + rank.add_edge(360, 134, 1.0); + rank.add_edge(76, 6, 1.0); + rank.add_edge(13, 72, -1.0); + rank.add_edge(31, 10, 1.0); + rank.add_edge(453, 275, 1.0); + rank.add_edge(96, 93, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(85, 24, 0.0); + rank.add_edge(228, 205, 1.0); + rank.add_edge(93, 92, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(186, 243, 1.0); + rank.add_edge(53, 260, 1.0); + rank.add_edge(152, 151, 1.0); + rank.add_edge(9, 249, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(501, 151, 1.0); + rank.get_new_nodeid(); + rank.add_edge(445, 48, 1.0); + rank.add_edge(9, 119, 3.0); + rank.add_edge(97, 147, 4.0); + rank.add_edge(19, 112, -1.0); + rank.add_edge(90, 266, 1.0); + rank.add_edge(31, 205, 1.0); + rank.add_edge(69, 48, 1.0); + rank.get_new_nodeid(); + rank.add_edge(151, 503, 1.0); + rank.add_edge(4, 374, 2.0); + rank.add_edge(84, 194, 6.0); + rank.add_edge(4, 223, 1.0); + rank.get_new_nodeid(); + rank.add_edge(449, 35, 1.0); + rank.add_edge(221, 24, 1.0); + rank.add_edge(69, 171, 8.0); + rank.add_edge(149, 208, 2.0); + rank.get_new_nodeid(); + rank.add_edge(35, 364, 1.0); + rank.add_edge(30, 137, 5.0); + rank.get_new_nodeid(); + rank.add_edge(162, 84, 1.0); + rank.get_new_nodeid(); + rank.add_edge(77, 247, 1.0); + rank.add_edge(13, 32, 1.0); + rank.add_edge(35, 258, 1.0); + rank.get_new_nodeid(); + rank.add_edge(437, 45, 1.0); + rank.add_edge(462, 186, 1.0); + rank.get_new_nodeid(); + rank.add_edge(133, 24, -3.0); + rank.get_new_nodeid(); + rank.add_edge(124, 27, 1.0); + rank.add_edge(383, 114, 1.0); + rank.add_edge(126, 27, 1.0); + rank.add_edge(486, 27, 1.0); + rank.add_edge(42, 113, 1.0); + rank.add_edge(151, 501, 1.0); + rank.add_edge(270, 95, 7.0); + rank.get_new_nodeid(); + rank.add_edge(77, 511, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 322, 1.0); + rank.get_new_nodeid(); + rank.add_edge(106, 105, 1.0); + rank.add_edge(12, 115, 1.0); + rank.add_edge(317, 149, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 228, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(254, 145, 1.0); + rank.add_edge(153, 147, 1.0); + rank.add_edge(162, 147, 5.0); + rank.add_edge(153, 20, -1.0); + rank.get_new_nodeid(); + rank.add_edge(183, 72, -1.0); + rank.add_edge(44, 208, 0.0); + rank.get_new_nodeid(); + rank.add_edge(474, 1, -9.0); + rank.add_edge(48, 104, 1.0); + rank.add_edge(230, 345, 1.0); + rank.add_edge(149, 148, 1.0); + rank.add_edge(59, 17, -1.0); + rank.add_edge(105, 123, 1.0); + rank.get_new_nodeid(); + rank.add_edge(10, 519, 1.0); + rank.add_edge(34, 47, 1.0); + rank.add_edge(223, 50, 1.0); + rank.add_edge(12, 331, 6.0); + rank.add_edge(145, 326, 1.0); + rank.add_edge(97, 340, 1.0); + rank.add_edge(137, 21, 1.0); + rank.add_edge(23, 1, 0.0); + rank.add_edge(31, 46, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(219, 1, 1.0); + rank.get_new_nodeid(); + rank.add_edge(22, 21, 1.0); + rank.add_edge(51, 84, 1.0); + rank.add_edge(113, 324, 1.0); + rank.add_edge(53, 401, 1.0); + rank.add_edge(171, 70, 1.0); + rank.add_edge(468, 69, 1.0); + rank.add_edge(47, 34, 1.0); + rank.add_edge(163, 1, -2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(90, 89, 1.0); + rank.add_edge(153, 5, 8.0); + rank.add_edge(9, 172, -1.0); + rank.add_edge(93, 269, 1.0); + rank.add_edge(9, 233, 1.0); + rank.add_edge(511, 77, 1.0); + rank.add_edge(84, 30, 1.0); + rank.get_new_nodeid(); + rank.add_edge(170, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(173, 12, 1.0); + rank.add_edge(30, 204, 5.0); + rank.get_new_nodeid(); + rank.add_edge(42, 7, 2.0); + rank.get_new_nodeid(); + rank.add_edge(9, 161, 3.0); + rank.add_edge(17, 186, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 49, 1.0); + rank.add_edge(48, 251, 1.0); + rank.add_edge(6, 156, 1.0); + rank.get_new_nodeid(); + rank.add_edge(210, 209, 1.0); + rank.add_edge(110, 17, -1.0); + rank.add_edge(131, 48, 1.0); + rank.add_edge(31, 208, 1.0); + rank.get_new_nodeid(); + rank.add_edge(187, 186, 1.0); + rank.add_edge(157, 0, 1.0); + rank.add_edge(519, 10, 1.0); + rank.add_edge(39, 241, 6.0); + rank.add_edge(159, 302, 1.0); + rank.get_new_nodeid(); + rank.add_edge(74, 73, 1.0); + rank.get_new_nodeid(); + rank.add_edge(336, 396, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(503, 151, 1.0); + rank.add_edge(337, 336, 1.0); + rank.add_edge(120, 174, 1.0); + rank.add_edge(48, 254, 6.0); + rank.get_new_nodeid(); + rank.add_edge(268, 93, 1.0); + rank.add_edge(292, 27, 1.0); + rank.add_edge(9, 231, -1.0); + rank.add_edge(27, 311, 1.0); + rank.add_edge(369, 21, 1.0); + rank.add_edge(524, 7, -2.0); + rank.get_new_nodeid(); + rank.add_edge(48, 175, 3.0); + rank.add_edge(9, 191, -1.0); + rank.add_edge(110, 64, 3.0); + rank.calculate(253, 100).unwrap(); + rank.calculate(299, 100).unwrap(); + rank.calculate(407, 100).unwrap(); + rank.calculate(433, 100).unwrap(); + rank.calculate(312, 100).unwrap(); + rank.calculate(477, 100).unwrap(); + rank.calculate(45, 100).unwrap(); + rank.calculate(508, 100).unwrap(); + rank.calculate(102, 100).unwrap(); + rank.calculate(287, 100).unwrap(); + rank.calculate(124, 100).unwrap(); + rank.calculate(356, 100).unwrap(); + rank.calculate(507, 100).unwrap(); + rank.calculate(523, 100).unwrap(); + rank.calculate(332, 100).unwrap(); + rank.calculate(355, 100).unwrap(); + rank.calculate(367, 100).unwrap(); + rank.calculate(370, 100).unwrap(); + rank.calculate(527, 100).unwrap(); + rank.calculate(245, 100).unwrap(); + rank.calculate(238, 100).unwrap(); + rank.calculate(413, 100).unwrap(); + rank.calculate(108, 100).unwrap(); + rank.calculate(122, 100).unwrap(); + rank.calculate(518, 100).unwrap(); + rank.calculate(443, 100).unwrap(); + rank.calculate(439, 100).unwrap(); + rank.calculate(429, 100).unwrap(); + rank.calculate(321, 100).unwrap(); + rank.calculate(97, 100).unwrap(); + rank.calculate(162, 100).unwrap(); + rank.calculate(488, 100).unwrap(); + rank.calculate(44, 100).unwrap(); + rank.calculate(465, 100).unwrap(); + rank.calculate(368, 100).unwrap(); + rank.calculate(446, 100).unwrap(); + rank.calculate(365, 100).unwrap(); + rank.calculate(239, 100).unwrap(); + rank.calculate(371, 100).unwrap(); + rank.calculate(485, 100).unwrap(); + rank.calculate(334, 100).unwrap(); + rank.calculate(199, 100).unwrap(); + rank.calculate(525, 100).unwrap(); + rank.calculate(179, 100).unwrap(); + rank.calculate(18, 100).unwrap(); + rank.calculate(404, 100).unwrap(); + rank.calculate(6, 100).unwrap(); + rank.calculate(0, 100).unwrap(); + rank.calculate(416, 100).unwrap(); + rank.calculate(495, 100).unwrap(); + rank.calculate(160, 100).unwrap(); + rank.calculate(351, 100).unwrap(); + rank.calculate(169, 100).unwrap(); + rank.calculate(214, 100).unwrap(); + rank.calculate(295, 100).unwrap(); + rank.calculate(291, 100).unwrap(); + rank.calculate(30, 100).unwrap(); + rank.calculate(55, 100).unwrap(); + rank.calculate(530, 100).unwrap(); + rank.calculate(164, 100).unwrap(); + rank.calculate(535, 100).unwrap(); + rank.calculate(94, 100).unwrap(); + rank.calculate(516, 100).unwrap(); + rank.calculate(419, 100).unwrap(); + rank.calculate(366, 100).unwrap(); + rank.calculate(235, 100).unwrap(); + rank.calculate(273, 100).unwrap(); + rank.calculate(188, 100).unwrap(); + rank.calculate(192, 100).unwrap(); + rank.calculate(167, 100).unwrap(); + rank.calculate(360, 100).unwrap(); + rank.calculate(412, 100).unwrap(); + rank.calculate(381, 100).unwrap(); + rank.calculate(352, 100).unwrap(); + rank.calculate(482, 100).unwrap(); + rank.calculate(318, 100).unwrap(); + rank.calculate(210, 100).unwrap(); + rank.calculate(424, 100).unwrap(); + rank.calculate(379, 100).unwrap(); + rank.calculate(358, 100).unwrap(); + rank.calculate(4, 100).unwrap(); + rank.calculate(101, 100).unwrap(); + rank.calculate(31, 100).unwrap(); + rank.calculate(496, 100).unwrap(); + rank.calculate(457, 100).unwrap(); + rank.calculate(16, 100).unwrap(); + rank.calculate(313, 100).unwrap(); + rank.calculate(382, 100).unwrap(); + rank.calculate(490, 100).unwrap(); + rank.calculate(435, 100).unwrap(); + rank.calculate(484, 100).unwrap(); + rank.calculate(375, 100).unwrap(); + rank.calculate(166, 100).unwrap(); + rank.calculate(144, 100).unwrap(); + rank.calculate(78, 100).unwrap(); + rank.calculate(289, 100).unwrap(); + rank.calculate(533, 100).unwrap(); + rank.calculate(190, 100).unwrap(); + rank.calculate(136, 100).unwrap(); + rank.calculate(276, 100).unwrap(); + rank.calculate(293, 100).unwrap(); + rank.calculate(519, 100).unwrap(); + rank.calculate(43, 100).unwrap(); + rank.calculate(201, 100).unwrap(); + rank.calculate(406, 100).unwrap(); + rank.calculate(521, 100).unwrap(); + rank.calculate(13, 100).unwrap(); + rank.calculate(515, 100).unwrap(); + rank.calculate(491, 100).unwrap(); + rank.calculate(74, 100).unwrap(); + rank.calculate(41, 100).unwrap(); + rank.calculate(335, 100).unwrap(); + rank.calculate(230, 100).unwrap(); + rank.calculate(56, 100).unwrap(); + rank.calculate(8, 100).unwrap(); + rank.calculate(265, 100).unwrap(); + rank.calculate(336, 100).unwrap(); + rank.calculate(42, 100).unwrap(); + rank.calculate(93, 100).unwrap(); + rank.calculate(300, 100).unwrap(); + rank.calculate(178, 100).unwrap(); + rank.calculate(84, 100).unwrap(); + rank.calculate(35, 100).unwrap(); + rank.calculate(40, 100).unwrap(); + rank.calculate(143, 100).unwrap(); + rank.calculate(514, 100).unwrap(); + rank.calculate(127, 100).unwrap(); + rank.calculate(130, 100).unwrap(); + rank.calculate(466, 100).unwrap(); + rank.calculate(493, 100).unwrap(); + rank.calculate(183, 100).unwrap(); + rank.calculate(50, 100).unwrap(); + rank.calculate(58, 100).unwrap(); + rank.calculate(263, 100).unwrap(); + rank.calculate(476, 100).unwrap(); + rank.calculate(79, 100).unwrap(); + rank.calculate(217, 100).unwrap(); + rank.calculate(177, 100).unwrap(); + rank.calculate(315, 100).unwrap(); + rank.calculate(248, 100).unwrap(); + rank.calculate(502, 100).unwrap(); + rank.calculate(267, 100).unwrap(); + rank.calculate(510, 100).unwrap(); + rank.calculate(228, 100).unwrap(); + rank.calculate(442, 100).unwrap(); + rank.calculate(65, 100).unwrap(); + rank.calculate(70, 100).unwrap(); + rank.calculate(203, 100).unwrap(); + rank.calculate(319, 100).unwrap(); + rank.calculate(62, 100).unwrap(); + rank.calculate(378, 100).unwrap(); + rank.calculate(423, 100).unwrap(); + rank.calculate(444, 100).unwrap(); + rank.calculate(471, 100).unwrap(); + rank.calculate(480, 100).unwrap(); + rank.calculate(151, 100).unwrap(); + rank.calculate(282, 100).unwrap(); + rank.calculate(489, 100).unwrap(); + rank.calculate(21, 100).unwrap(); + rank.calculate(141, 100).unwrap(); + rank.calculate(114, 100).unwrap(); + rank.calculate(59, 100).unwrap(); + rank.calculate(306, 100).unwrap(); + rank.calculate(325, 100).unwrap(); + rank.calculate(219, 100).unwrap(); + rank.calculate(280, 100).unwrap(); + rank.calculate(57, 100).unwrap(); + rank.calculate(221, 100).unwrap(); + rank.calculate(506, 100).unwrap(); + rank.calculate(410, 100).unwrap(); + rank.calculate(67, 100).unwrap(); + rank.calculate(91, 100).unwrap(); + rank.calculate(113, 100).unwrap(); + rank.calculate(425, 100).unwrap(); + rank.calculate(198, 100).unwrap(); + rank.calculate(272, 100).unwrap(); + rank.calculate(353, 100).unwrap(); + rank.calculate(451, 100).unwrap(); + rank.calculate(494, 100).unwrap(); + rank.calculate(456, 100).unwrap(); + rank.calculate(513, 100).unwrap(); + rank.calculate(53, 100).unwrap(); + rank.calculate(526, 100).unwrap(); + rank.calculate(420, 100).unwrap(); + rank.calculate(80, 100).unwrap(); + rank.calculate(2, 100).unwrap(); + rank.calculate(498, 100).unwrap(); + rank.calculate(499, 100).unwrap(); + rank.calculate(509, 100).unwrap(); + rank.calculate(186, 100).unwrap(); + rank.calculate(234, 100).unwrap(); + rank.calculate(430, 100).unwrap(); + rank.calculate(224, 100).unwrap(); + rank.calculate(222, 100).unwrap(); + rank.calculate(28, 100).unwrap(); + rank.calculate(415, 100).unwrap(); + rank.calculate(447, 100).unwrap(); + rank.calculate(257, 100).unwrap(); + rank.calculate(427, 100).unwrap(); + rank.calculate(487, 100).unwrap(); + rank.calculate(180, 100).unwrap(); + rank.calculate(133, 100).unwrap(); + rank.calculate(417, 100).unwrap(); + rank.calculate(532, 100).unwrap(); + rank.calculate(524, 100).unwrap(); + rank.calculate(483, 100).unwrap(); + rank.calculate(297, 100).unwrap(); + rank.calculate(68, 100).unwrap(); + rank.calculate(226, 100).unwrap(); + rank.calculate(463, 100).unwrap(); + rank.calculate(99, 100).unwrap(); + rank.calculate(403, 100).unwrap(); + rank.calculate(441, 100).unwrap(); + rank.calculate(77, 100).unwrap(); + rank.calculate(85, 100).unwrap(); + rank.calculate(348, 100).unwrap(); + rank.calculate(504, 100).unwrap(); + rank.calculate(12, 100).unwrap(); + rank.calculate(388, 100).unwrap(); + rank.calculate(342, 100).unwrap(); + rank.calculate(362, 100).unwrap(); + rank.calculate(534, 100).unwrap(); + rank.calculate(333, 100).unwrap(); + rank.calculate(200, 100).unwrap(); + rank.calculate(384, 100).unwrap(); + rank.calculate(33, 100).unwrap(); + rank.calculate(440, 100).unwrap(); + rank.calculate(475, 100).unwrap(); + rank.calculate(460, 100).unwrap(); + rank.calculate(517, 100).unwrap(); + rank.calculate(255, 100).unwrap(); + rank.calculate(537, 100).unwrap(); + rank.calculate(275, 100).unwrap(); + rank.calculate(145, 100).unwrap(); + rank.calculate(87, 100).unwrap(); + rank.calculate(434, 100).unwrap(); + rank.calculate(39, 100).unwrap(); + rank.calculate(262, 100).unwrap(); + rank.calculate(285, 100).unwrap(); + rank.calculate(469, 100).unwrap(); + rank.calculate(390, 100).unwrap(); + rank.calculate(343, 100).unwrap(); + rank.calculate(36, 100).unwrap(); + rank.calculate(52, 100).unwrap(); + rank.calculate(90, 100).unwrap(); + rank.calculate(15, 100).unwrap(); + rank.calculate(421, 100).unwrap(); + rank.calculate(196, 100).unwrap(); + rank.calculate(163, 100).unwrap(); + rank.calculate(400, 100).unwrap(); + rank.calculate(505, 100).unwrap(); + rank.calculate(422, 100).unwrap(); + rank.calculate(330, 100).unwrap(); + rank.calculate(464, 100).unwrap(); + rank.calculate(11, 100).unwrap(); + rank.calculate(47, 100).unwrap(); + rank.calculate(314, 100).unwrap(); + rank.calculate(76, 100).unwrap(); + rank.calculate(344, 100).unwrap(); + rank.calculate(520, 100).unwrap(); + rank.calculate(459, 100).unwrap(); + rank.calculate(218, 100).unwrap(); + rank.calculate(536, 100).unwrap(); + rank.calculate(492, 100).unwrap(); + rank.calculate(149, 100).unwrap(); + rank.calculate(120, 100).unwrap(); + rank.calculate(323, 100).unwrap(); + rank.calculate(346, 100).unwrap(); + rank.calculate(104, 100).unwrap(); + rank.calculate(19, 100).unwrap(); + rank.calculate(63, 100).unwrap(); + rank.calculate(107, 100).unwrap(); + rank.calculate(481, 100).unwrap(); + rank.calculate(138, 100).unwrap(); + rank.calculate(23, 100).unwrap(); + rank.calculate(153, 100).unwrap(); + rank.calculate(207, 100).unwrap(); + rank.calculate(411, 100).unwrap(); + rank.calculate(193, 100).unwrap(); + rank.calculate(232, 100).unwrap(); + rank.calculate(327, 100).unwrap(); + rank.calculate(512, 100).unwrap(); + rank.calculate(159, 100).unwrap(); + rank.calculate(105, 100).unwrap(); + rank.calculate(48, 100).unwrap(); + rank.calculate(270, 100).unwrap(); + rank.calculate(9, 100).unwrap(); + rank.calculate(393, 100).unwrap(); + rank.calculate(529, 100).unwrap(); + rank.calculate(350, 100).unwrap(); + rank.calculate(472, 100).unwrap(); + rank.calculate(181, 100).unwrap(); + rank.calculate(380, 100).unwrap(); + rank.calculate(414, 100).unwrap(); + rank.calculate(197, 100).unwrap(); + rank.calculate(189, 100).unwrap(); + rank.calculate(431, 100).unwrap(); + rank.calculate(110, 100).unwrap(); + rank.calculate(284, 100).unwrap(); + rank.calculate(426, 100).unwrap(); + rank.calculate(142, 100).unwrap(); + rank.calculate(259, 100).unwrap(); + rank.calculate(303, 100).unwrap(); + rank.calculate(402, 100).unwrap(); + rank.calculate(211, 100).unwrap(); + rank.calculate(283, 100).unwrap(); + rank.calculate(288, 100).unwrap(); + rank.calculate(392, 100).unwrap(); + rank.calculate(281, 100).unwrap(); + rank.calculate(478, 100).unwrap(); + rank.calculate(215, 100).unwrap(); + rank.calculate(385, 100).unwrap(); + rank.calculate(528, 100).unwrap(); + rank.calculate(82, 100).unwrap(); + rank.calculate(474, 100).unwrap(); + rank.calculate(117, 100).unwrap(); + rank.calculate(418, 100).unwrap(); + rank.calculate(448, 100).unwrap(); + rank.calculate(150, 100).unwrap(); + rank.calculate(132, 100).unwrap(); + rank.calculate(397, 100).unwrap(); + rank.calculate(467, 100).unwrap(); + rank.calculate(473, 100).unwrap(); + rank.calculate(479, 100).unwrap(); + rank.calculate(27, 100).unwrap(); + rank.calculate(29, 100).unwrap(); + rank.calculate(386, 100).unwrap(); + rank.calculate(195, 100).unwrap(); + rank.calculate(497, 100).unwrap(); + rank.calculate(500, 100).unwrap(); + rank.calculate(69, 100).unwrap(); + rank.calculate(531, 100).unwrap(); + rank.calculate(454, 100).unwrap(); + rank.calculate(349, 100).unwrap(); + rank.calculate(522, 100).unwrap(); + + let begin = SystemTime::now(); + let get_time = || SystemTime::now().duration_since(begin).unwrap().as_millis(); + + // Should be fast! + + println!("1"); + rank.add_edge(3, 35, 0.6870330406793382); + assert!(get_time() < 5000); + + println!("2"); + rank.add_edge(3, 27, 0.6750305618933777); + assert!(get_time() < 5000); + + println!("3"); + rank.add_edge(3, 252, 0.6709551330130799); + assert!(get_time() < 5000); + + println!("4"); + rank.add_edge(3, 24, 0.6658611955039131); + assert!(get_time() < 5000); + + println!("5"); + rank.add_edge(3, 286, 0.6332146304754731); + assert!(get_time() < 5000); + + println!("6"); + rank.add_edge(3, 208, 0.6148736192067291); + assert!(get_time() < 5000); + } + + #[test] + fn smoke_perf_with_zero() { + let mut rank = MeritRank::new(Graph::new()).unwrap(); + + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(0, 1, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(2, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(4, 5, 9.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(6, 7, 7.0); + rank.get_new_nodeid(); + rank.add_edge(8, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(9, 10, 3.0); + rank.get_new_nodeid(); + rank.add_edge(11, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(12, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(13, 14, -1.0); + rank.get_new_nodeid(); + rank.add_edge(15, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(16, 17, -1.0); + rank.get_new_nodeid(); + rank.add_edge(18, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(19, 20, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(21, 22, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(23, 24, 0.0); + rank.get_new_nodeid(); + rank.add_edge(9, 25, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(26, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(28, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(29, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(30, 22, 4.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(31, 32, 1.0); + rank.get_new_nodeid(); + rank.add_edge(33, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 34, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 35, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(36, 37, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(38, 39, 1.0); + rank.get_new_nodeid(); + rank.add_edge(40, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(41, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(42, 1, 6.0); + rank.add_edge(35, 14, -1.0); + rank.get_new_nodeid(); + rank.add_edge(43, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(44, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(45, 46, -2.0); + rank.get_new_nodeid(); + rank.add_edge(47, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(48, 49, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(50, 51, 5.0); + rank.add_edge(24, 27, 1.0); + rank.add_edge(31, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(52, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(53, 54, 1.0); + rank.get_new_nodeid(); + rank.add_edge(55, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(56, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(57, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(58, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(59, 60, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(61, 62, 1.0); + rank.get_new_nodeid(); + rank.add_edge(63, 24, -2.0); + rank.get_new_nodeid(); + rank.add_edge(64, 0, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(65, 66, 1.0); + rank.get_new_nodeid(); + rank.add_edge(67, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(68, 7, 2.0); + rank.get_new_nodeid(); + rank.add_edge(69, 3, 1.0); + rank.add_edge(30, 49, 6.0); + rank.get_new_nodeid(); + rank.add_edge(70, 22, 3.0); + rank.get_new_nodeid(); + rank.add_edge(53, 71, 1.0); + rank.get_new_nodeid(); + rank.add_edge(72, 48, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(73, 74, 1.0); + rank.add_edge(21, 6, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(75, 76, 1.0); + rank.add_edge(70, 14, 1.0); + rank.get_new_nodeid(); + rank.add_edge(77, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(78, 24, 1.0); + rank.get_new_nodeid(); + rank.add_edge(79, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(80, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 81, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(82, 83, 1.0); + rank.add_edge(23, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(84, 51, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(85, 86, 1.0); + rank.get_new_nodeid(); + rank.add_edge(87, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(88, 48, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(89, 90, 1.0); + rank.get_new_nodeid(); + rank.add_edge(91, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(92, 93, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(94, 95, -1.0); + rank.get_new_nodeid(); + rank.add_edge(93, 96, 1.0); + rank.get_new_nodeid(); + rank.add_edge(97, 88, 8.0); + rank.get_new_nodeid(); + rank.add_edge(13, 98, -1.0); + rank.add_edge(31, 42, 1.0); + rank.get_new_nodeid(); + rank.add_edge(99, 3, 1.0); + rank.add_edge(13, 51, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 100, -1.0); + rank.add_edge(68, 96, 1.0); + rank.get_new_nodeid(); + rank.add_edge(101, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(102, 103, 1.0); + rank.get_new_nodeid(); + rank.add_edge(104, 76, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(105, 106, 1.0); + rank.get_new_nodeid(); + rank.add_edge(107, 72, 0.0); + rank.get_new_nodeid(); + rank.add_edge(108, 1, 14.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(109, 110, 1.0); + rank.get_new_nodeid(); + rank.add_edge(50, 111, 6.0); + rank.get_new_nodeid(); + rank.add_edge(112, 76, 1.0); + rank.get_new_nodeid(); + rank.add_edge(113, 27, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(114, 115, 4.0); + rank.get_new_nodeid(); + rank.add_edge(110, 116, 1.0); + rank.add_edge(9, 32, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(117, 118, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(119, 120, 1.0); + rank.get_new_nodeid(); + rank.add_edge(59, 121, 1.0); + rank.get_new_nodeid(); + rank.add_edge(122, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(123, 105, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(124, 125, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 126, 1.0); + rank.get_new_nodeid(); + rank.add_edge(127, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(85, 128, 1.0); + rank.get_new_nodeid(); + rank.add_edge(104, 129, 1.0); + rank.add_edge(27, 26, 1.0); + rank.get_new_nodeid(); + rank.add_edge(130, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(114, 131, 2.0); + rank.get_new_nodeid(); + rank.add_edge(132, 1, 1.0); + rank.get_new_nodeid(); + rank.add_edge(133, 3, 1.0); + rank.add_edge(9, 125, 1.0); + rank.get_new_nodeid(); + rank.add_edge(82, 134, 1.0); + rank.get_new_nodeid(); + rank.add_edge(135, 56, 1.0); + rank.add_edge(84, 88, 9.0); + rank.get_new_nodeid(); + rank.add_edge(136, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(21, 137, 1.0); + rank.get_new_nodeid(); + rank.add_edge(138, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 139, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(140, 141, 1.0); + rank.get_new_nodeid(); + rank.add_edge(142, 25, 1.0); + rank.add_edge(9, 98, -1.0); + rank.get_new_nodeid(); + rank.add_edge(143, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(144, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(145, 146, 8.0); + rank.get_new_nodeid(); + rank.add_edge(97, 147, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(148, 149, 1.0); + rank.add_edge(9, 24, 3.0); + rank.get_new_nodeid(); + rank.add_edge(150, 46, 2.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(151, 152, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(153, 154, 3.0); + rank.add_edge(13, 46, 1.0); + rank.get_new_nodeid(); + rank.add_edge(155, 31, 1.0); + rank.add_edge(69, 14, 2.0); + rank.add_edge(4, 76, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 156, -1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 157, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(158, 159, 1.0); + rank.add_edge(69, 129, 2.0); + rank.get_new_nodeid(); + rank.add_edge(160, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 161, 1.0); + rank.get_new_nodeid(); + rank.add_edge(162, 76, -1.0); + rank.add_edge(45, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(163, 3, 1.0); + rank.add_edge(19, 81, 1.0); + rank.get_new_nodeid(); + rank.add_edge(164, 3, 1.0); + rank.add_edge(147, 97, 1.0); + rank.get_new_nodeid(); + rank.add_edge(124, 165, 1.0); + rank.add_edge(161, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(166, 3, 1.0); + rank.add_edge(9, 54, 3.0); + rank.add_edge(65, 24, 2.0); + rank.add_edge(48, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(167, 3, 1.0); + rank.add_edge(151, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(107, 168, 1.0); + rank.add_edge(65, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(169, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 170, 1.0); + rank.add_edge(149, 24, 5.0); + rank.get_new_nodeid(); + rank.add_edge(70, 171, 1.0); + rank.add_edge(110, 72, -1.0); + rank.get_new_nodeid(); + rank.add_edge(172, 69, 1.0); + rank.get_new_nodeid(); + rank.add_edge(113, 173, -11.0); + rank.add_edge(104, 75, 4.0); + rank.add_edge(125, 9, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 174, 1.0); + rank.add_edge(0, 10, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 175, -1.0); + rank.get_new_nodeid(); + rank.add_edge(176, 35, 1.0); + rank.get_new_nodeid(); + rank.add_edge(177, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(178, 3, 1.0); + rank.add_edge(84, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(179, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(180, 95, 3.0); + rank.add_edge(69, 12, 1.0); + rank.add_edge(150, 3, 1.0); + rank.add_edge(13, 9, 1.0); + rank.add_edge(146, 4, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(181, 182, 1.0); + rank.add_edge(0, 24, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(183, 184, 1.0); + rank.get_new_nodeid(); + rank.add_edge(185, 13, 1.0); + rank.add_edge(9, 46, 3.0); + rank.add_edge(48, 162, 1.0); + rank.add_edge(31, 13, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(186, 187, 1.0); + rank.get_new_nodeid(); + rank.add_edge(188, 3, 1.0); + rank.add_edge(4, 14, 9.0); + rank.get_new_nodeid(); + rank.add_edge(189, 3, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(190, 191, -1.0); + rank.add_edge(116, 110, 1.0); + rank.get_new_nodeid(); + rank.add_edge(192, 24, -1.0); + rank.add_edge(47, 175, 3.0); + rank.get_new_nodeid(); + rank.add_edge(193, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(50, 194, 1.0); + rank.get_new_nodeid(); + rank.add_edge(195, 3, 1.0); + rank.add_edge(31, 35, 1.0); + rank.add_edge(145, 191, 3.0); + rank.add_edge(31, 9, 1.0); + rank.add_edge(31, 51, -1.0); + rank.add_edge(19, 154, 6.0); + rank.get_new_nodeid(); + rank.add_edge(196, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(197, 3, 1.0); + rank.add_edge(76, 114, -1.0); + rank.add_edge(35, 81, -1.0); + rank.get_new_nodeid(); + rank.add_edge(198, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(199, 3, 1.0); + rank.add_edge(48, 22, 5.0); + rank.get_new_nodeid(); + rank.add_edge(200, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(201, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(4, 202, 4.0); + rank.add_edge(31, 34, -1.0); + rank.get_new_nodeid(); + rank.add_edge(203, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 204, -1.0); + rank.add_edge(19, 49, 1.0); + rank.get_new_nodeid(); + rank.add_edge(205, 35, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 206, 1.0); + rank.add_edge(83, 13, 1.0); + rank.add_edge(110, 13, 1.0); + rank.add_edge(82, 46, 1.0); + rank.add_edge(114, 168, -1.0); + rank.add_edge(12, 173, 1.0); + rank.get_new_nodeid(); + rank.add_edge(207, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 208, 3.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(209, 210, 1.0); + rank.get_new_nodeid(); + rank.add_edge(211, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(113, 212, 1.0); + rank.get_new_nodeid(); + rank.add_edge(76, 213, 1.0); + rank.add_edge(31, 185, 1.0); + rank.add_edge(6, 70, 1.0); + rank.get_new_nodeid(); + rank.add_edge(214, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(215, 205, 5.0); + rank.get_new_nodeid(); + rank.add_edge(216, 31, 1.0); + rank.add_edge(153, 114, 1.0); + rank.add_edge(62, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(217, 3, 1.0); + rank.add_edge(183, 1, 3.0); + rank.get_new_nodeid(); + rank.add_edge(218, 3, 1.0); + rank.add_edge(110, 175, -9.0); + rank.get_new_nodeid(); + rank.add_edge(219, 3, 1.0); + rank.add_edge(132, 7, -1.0); + rank.get_new_nodeid(); + rank.add_edge(220, 151, 1.0); + rank.add_edge(30, 3, 1.0); + rank.add_edge(124, 205, 1.0); + rank.add_edge(103, 102, 1.0); + rank.get_new_nodeid(); + rank.add_edge(221, 3, 1.0); + rank.add_edge(215, 35, 1.0); + rank.add_edge(108, 115, -4.0); + rank.add_edge(74, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(222, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(50, 223, 3.0); + rank.get_new_nodeid(); + rank.add_edge(224, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(225, 77, 1.0); + rank.get_new_nodeid(); + rank.add_edge(226, 3, 1.0); + rank.add_edge(39, 75, 2.0); + rank.add_edge(104, 153, -1.0); + rank.add_edge(145, 75, -1.0); + rank.add_edge(82, 165, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 227, 1.0); + rank.get_new_nodeid(); + rank.add_edge(35, 228, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(229, 230, 1.0); + rank.get_new_nodeid(); + rank.add_edge(231, 150, 1.0); + rank.get_new_nodeid(); + rank.add_edge(232, 3, 1.0); + rank.add_edge(113, 18, 1.0); + rank.get_new_nodeid(); + rank.add_edge(233, 9, 1.0); + rank.add_edge(210, 24, -2.0); + rank.add_edge(31, 191, -1.0); + rank.get_new_nodeid(); + rank.add_edge(234, 3, 1.0); + rank.add_edge(9, 26, 2.0); + rank.get_new_nodeid(); + rank.add_edge(235, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(236, 107, 1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 237, 1.0); + rank.add_edge(98, 215, 1.0); + rank.add_edge(145, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(238, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(239, 46, 4.0); + rank.add_edge(100, 19, 1.0); + rank.get_new_nodeid(); + rank.add_edge(6, 240, 1.0); + rank.add_edge(108, 72, -8.0); + rank.add_edge(9, 175, -1.0); + rank.add_edge(27, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(241, 39, 1.0); + rank.add_edge(230, 1, -2.0); + rank.add_edge(82, 237, 1.0); + rank.get_new_nodeid(); + rank.add_edge(242, 53, 1.0); + rank.get_new_nodeid(); + rank.add_edge(243, 186, 1.0); + rank.get_new_nodeid(); + rank.add_edge(114, 244, 2.0); + rank.get_new_nodeid(); + rank.add_edge(245, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(30, 246, 5.0); + rank.add_edge(19, 244, 1.0); + rank.add_edge(39, 49, 4.0); + rank.get_new_nodeid(); + rank.add_edge(247, 77, 1.0); + rank.add_edge(20, 19, 1.0); + rank.add_edge(4, 213, 8.0); + rank.add_edge(30, 240, 3.0); + rank.get_new_nodeid(); + rank.add_edge(248, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(249, 12, 1.0); + rank.add_edge(13, 83, 1.0); + rank.add_edge(121, 59, 1.0); + rank.get_new_nodeid(); + rank.add_edge(250, 153, 1.0); + rank.add_edge(13, 109, -1.0); + rank.add_edge(150, 24, 4.0); + rank.add_edge(113, 24, 10.0); + rank.add_edge(227, 35, 1.0); + rank.add_edge(141, 3, 1.0); + rank.add_edge(151, 7, 0.0); + rank.add_edge(6, 111, 1.0); + rank.add_edge(104, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 251, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 252, 3.0); + rank.get_new_nodeid(); + rank.add_edge(253, 3, 1.0); + rank.add_edge(4, 246, 4.0); + rank.get_new_nodeid(); + rank.add_edge(145, 254, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(255, 256, 1.0); + rank.add_edge(18, 139, 1.0); + rank.add_edge(21, 22, 5.0); + rank.get_new_nodeid(); + rank.add_edge(9, 257, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 258, 1.0); + rank.add_edge(150, 172, -5.0); + rank.add_edge(159, 24, -1.0); + rank.get_new_nodeid(); + rank.add_edge(259, 24, -1.0); + rank.add_edge(35, 1, -1.0); + rank.get_new_nodeid(); + rank.add_edge(31, 260, 1.0); + rank.get_new_nodeid(); + rank.add_edge(21, 261, 9.0); + rank.add_edge(255, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(262, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(263, 1, 1.0); + rank.get_new_nodeid(); + rank.add_edge(85, 264, 1.0); + rank.get_new_nodeid(); + rank.add_edge(265, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(266, 90, 1.0); + rank.get_new_nodeid(); + rank.add_edge(267, 3, 1.0); + rank.add_edge(31, 165, 1.0); + rank.get_new_nodeid(); + rank.add_edge(93, 268, 1.0); + rank.add_edge(48, 129, -1.0); + rank.get_new_nodeid(); + rank.add_edge(269, 93, 1.0); + rank.add_edge(107, 236, 1.0); + rank.add_edge(129, 104, 1.0); + rank.add_edge(175, 39, 1.0); + rank.get_new_nodeid(); + rank.add_edge(270, 73, -7.0); + rank.add_edge(63, 72, 2.0); + rank.add_edge(32, 9, 1.0); + rank.add_edge(104, 194, 5.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(271, 272, 1.0); + rank.add_edge(246, 76, 1.0); + rank.add_edge(31, 155, 1.0); + rank.add_edge(21, 20, 2.0); + rank.add_edge(82, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(273, 3, 1.0); + rank.add_edge(31, 14, -1.0); + rank.get_new_nodeid(); + rank.add_edge(274, 84, 1.0); + rank.add_edge(48, 72, 1.0); + rank.get_new_nodeid(); + rank.add_edge(275, 3, 1.0); + rank.add_edge(13, 100, -1.0); + rank.get_new_nodeid(); + rank.add_edge(276, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(277, 44, 1.0); + rank.get_new_nodeid(); + rank.add_edge(69, 278, 4.0); + rank.get_new_nodeid(); + rank.add_edge(279, 45, 1.0); + rank.add_edge(162, 75, 7.0); + rank.add_edge(6, 69, 1.0); + rank.get_new_nodeid(); + rank.add_edge(280, 3, 1.0); + rank.add_edge(255, 257, 1.0); + rank.get_new_nodeid(); + rank.add_edge(281, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(282, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(283, 3, 1.0); + rank.add_edge(82, 185, 1.0); + rank.get_new_nodeid(); + rank.add_edge(284, 3, 1.0); + rank.add_edge(45, 279, 1.0); + rank.get_new_nodeid(); + rank.add_edge(285, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 286, 1.0); + rank.get_new_nodeid(); + rank.add_edge(287, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(288, 3, 1.0); + rank.add_edge(239, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(289, 24, 1.0); + rank.get_new_nodeid(); + rank.add_edge(21, 290, 1.0); + rank.get_new_nodeid(); + rank.add_edge(291, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 292, 1.0); + rank.add_edge(115, 12, 1.0); + rank.get_new_nodeid(); + rank.add_edge(293, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 294, 1.0); + rank.add_edge(13, 204, -1.0); + rank.get_new_nodeid(); + rank.add_edge(295, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(13, 296, 1.0); + rank.get_new_nodeid(); + rank.add_edge(297, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(298, 110, 1.0); + rank.get_new_nodeid(); + rank.add_edge(299, 3, 1.0); + rank.add_edge(35, 165, 1.0); + rank.add_edge(113, 17, 3.0); + rank.add_edge(151, 220, 1.0); + rank.get_new_nodeid(); + rank.add_edge(300, 3, 1.0); + rank.add_edge(35, 191, -1.0); + rank.add_edge(16, 24, 2.0); + rank.get_new_nodeid(); + rank.add_edge(301, 159, 1.0); + rank.add_edge(124, 25, 1.0); + rank.get_new_nodeid(); + rank.add_edge(302, 159, 1.0); + rank.add_edge(39, 72, 7.0); + rank.get_new_nodeid(); + rank.add_edge(303, 3, 1.0); + rank.add_edge(84, 147, -1.0); + rank.add_edge(9, 14, -1.0); + rank.get_new_nodeid(); + rank.add_edge(304, 257, 1.0); + rank.add_edge(50, 173, 9.0); + rank.add_edge(141, 24, 2.0); + rank.add_edge(35, 205, 1.0); + rank.get_new_nodeid(); + rank.add_edge(163, 305, 1.0); + rank.add_edge(244, 19, 1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(306, 307, 1.0); + rank.add_edge(290, 21, 1.0); + rank.add_edge(27, 252, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 308, 1.0); + rank.add_edge(25, 142, 1.0); + rank.get_new_nodeid(); + rank.add_edge(53, 309, -18.0); + rank.get_new_nodeid(); + rank.add_edge(280, 310, 1.0); + rank.get_new_nodeid(); + rank.add_edge(311, 27, 1.0); + rank.add_edge(16, 3, 1.0); + rank.add_edge(62, 61, 1.0); + rank.add_edge(30, 7, 2.0); + rank.get_new_nodeid(); + rank.add_edge(312, 3, 1.0); + rank.add_edge(104, 154, 5.0); + rank.get_new_nodeid(); + rank.add_edge(313, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(314, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(315, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(79, 316, 1.0); + rank.get_new_nodeid(); + rank.add_edge(110, 317, 5.0); + rank.add_edge(141, 140, 1.0); + rank.add_edge(35, 24, 4.0); + rank.add_edge(76, 246, 1.0); + rank.get_new_nodeid(); + rank.add_edge(318, 3, 1.0); + rank.add_edge(296, 13, 1.0); + rank.add_edge(18, 46, 7.0); + rank.get_new_nodeid(); + rank.add_edge(319, 3, 1.0); + rank.add_edge(6, 131, 4.0); + rank.get_new_nodeid(); + rank.add_edge(9, 320, -1.0); + rank.get_new_nodeid(); + rank.add_edge(321, 3, 1.0); + rank.add_edge(260, 53, 1.0); + rank.add_edge(47, 14, -1.0); + rank.add_edge(305, 163, 1.0); + rank.add_edge(114, 3, 1.0); + rank.add_edge(82, 205, 1.0); + rank.add_edge(163, 72, 0.0); + rank.get_new_nodeid(); + rank.add_edge(322, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(323, 3, 1.0); + rank.add_edge(110, 109, 1.0); + rank.get_new_nodeid(); + rank.add_edge(0, 324, 1.0); + rank.add_edge(35, 72, -1.0); + rank.add_edge(71, 53, 1.0); + rank.get_new_nodeid(); + rank.add_edge(325, 3, 1.0); + rank.add_edge(183, 241, -3.0); + rank.add_edge(208, 27, 1.0); + rank.add_edge(204, 97, 1.0); + rank.add_edge(81, 19, 1.0); + rank.get_new_nodeid(); + rank.add_edge(4, 326, 6.0); + rank.get_new_nodeid(); + rank.add_edge(327, 3, 1.0); + rank.add_edge(9, 156, -1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 328, 1.0); + rank.get_new_nodeid(); + rank.add_edge(329, 275, 1.0); + rank.add_edge(120, 237, 1.0); + rank.get_new_nodeid(); + rank.add_edge(330, 3, 1.0); + rank.add_edge(275, 24, -4.0); + rank.add_edge(221, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(9, 331, 1.0); + rank.get_new_nodeid(); + rank.add_edge(332, 3, 1.0); + rank.add_edge(12, 249, 1.0); + rank.add_edge(113, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(333, 3, 1.0); + rank.add_edge(113, 156, -3.0); + rank.get_new_nodeid(); + rank.add_edge(334, 3, 1.0); + rank.add_edge(0, 64, 1.0); + rank.add_edge(110, 185, 3.0); + rank.add_edge(31, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(335, 3, 1.0); + rank.add_edge(70, 7, 3.0); + rank.add_edge(39, 38, 1.0); + rank.add_edge(13, 81, -1.0); + rank.get_new_nodeid(); + rank.get_new_nodeid(); + rank.add_edge(336, 337, 1.0); + rank.add_edge(21, 1, 1.0); + rank.add_edge(190, 24, 2.0); + rank.get_new_nodeid(); + rank.add_edge(338, 221, 1.0); + rank.add_edge(31, 172, -1.0); + rank.add_edge(306, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 339, 1.0); + rank.add_edge(294, 9, 1.0); + rank.add_edge(68, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(340, 97, 1.0); + rank.add_edge(213, 76, 1.0); + rank.add_edge(49, 19, 1.0); + rank.add_edge(69, 326, 1.0); + rank.add_edge(82, 64, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 341, 1.0); + rank.add_edge(48, 131, 1.0); + rank.get_new_nodeid(); + rank.add_edge(342, 3, 1.0); + rank.add_edge(13, 249, -1.0); + rank.get_new_nodeid(); + rank.add_edge(343, 3, 1.0); + rank.add_edge(114, 88, 7.0); + rank.add_edge(31, 72, -1.0); + rank.get_new_nodeid(); + rank.add_edge(344, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(345, 230, 1.0); + rank.add_edge(18, 7, -5.0); + rank.add_edge(110, 32, 3.0); + rank.get_new_nodeid(); + rank.add_edge(346, 3, 1.0); + rank.add_edge(48, 70, 1.0); + rank.get_new_nodeid(); + rank.add_edge(347, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(348, 3, 1.0); + rank.add_edge(134, 42, 1.0); + rank.add_edge(215, 98, 1.0); + rank.get_new_nodeid(); + rank.add_edge(349, 3, 1.0); + rank.add_edge(255, 304, 4.0); + rank.add_edge(76, 47, -1.0); + rank.add_edge(35, 6, 1.0); + rank.add_edge(21, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(350, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(351, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(352, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(353, 3, 1.0); + rank.add_edge(93, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(101, 354, 1.0); + rank.add_edge(336, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(355, 3, 1.0); + rank.add_edge(30, 47, 1.0); + rank.add_edge(12, 261, -1.0); + rank.add_edge(70, 223, 5.0); + rank.add_edge(31, 119, 1.0); + rank.add_edge(264, 85, 1.0); + rank.add_edge(230, 241, 1.0); + rank.get_new_nodeid(); + rank.add_edge(356, 3, 1.0); + rank.add_edge(85, 3, 1.0); + rank.add_edge(149, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(357, 44, 1.0); + rank.add_edge(240, 48, 1.0); + rank.add_edge(153, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(358, 3, 1.0); + rank.add_edge(12, 22, -1.0); + rank.add_edge(105, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(359, 31, 1.0); + rank.add_edge(95, 284, 1.0); + rank.add_edge(239, 172, 2.0); + rank.get_new_nodeid(); + rank.add_edge(360, 3, 1.0); + rank.add_edge(149, 32, 5.0); + rank.add_edge(86, 85, 1.0); + rank.add_edge(31, 216, 1.0); + rank.add_edge(21, 191, 1.0); + rank.add_edge(272, 271, 1.0); + rank.get_new_nodeid(); + rank.add_edge(361, 93, 1.0); + rank.get_new_nodeid(); + rank.add_edge(362, 3, 1.0); + rank.add_edge(0, 157, 1.0); + rank.add_edge(35, 204, -1.0); + rank.add_edge(110, 3, 1.0); + rank.add_edge(69, 172, 1.0); + rank.get_new_nodeid(); + rank.add_edge(363, 259, 1.0); + rank.add_edge(257, 304, 1.0); + rank.add_edge(9, 213, 1.0); + rank.add_edge(50, 129, 8.0); + rank.add_edge(104, 69, 1.0); + rank.add_edge(181, 24, 2.0); + rank.add_edge(113, 46, 1.0); + rank.get_new_nodeid(); + rank.add_edge(364, 35, 1.0); + rank.add_edge(31, 64, 1.0); + rank.get_new_nodeid(); + rank.add_edge(365, 3, 1.0); + rank.add_edge(162, 30, 1.0); + rank.get_new_nodeid(); + rank.add_edge(366, 3, 1.0); + rank.add_edge(9, 228, 1.0); + rank.add_edge(62, 24, 2.0); + rank.add_edge(110, 24, 9.0); + rank.get_new_nodeid(); + rank.add_edge(367, 3, 1.0); + rank.add_edge(68, 46, 5.0); + rank.add_edge(37, 36, 1.0); + rank.get_new_nodeid(); + rank.add_edge(368, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(97, 369, 9.0); + rank.get_new_nodeid(); + rank.add_edge(370, 3, 1.0); + rank.add_edge(60, 59, 1.0); + rank.add_edge(113, 191, -3.0); + rank.add_edge(50, 278, 1.0); + rank.get_new_nodeid(); + rank.add_edge(371, 3, 1.0); + rank.add_edge(107, 24, -1.0); + rank.add_edge(145, 70, -1.0); + rank.add_edge(35, 252, 4.0); + rank.add_edge(48, 5, 1.0); + rank.get_new_nodeid(); + rank.add_edge(372, 18, 1.0); + rank.add_edge(76, 38, 2.0); + rank.add_edge(259, 168, -1.0); + rank.get_new_nodeid(); + rank.add_edge(373, 9, 1.0); + rank.get_new_nodeid(); + rank.add_edge(50, 374, -1.0); + rank.add_edge(110, 83, 2.0); + rank.get_new_nodeid(); + rank.add_edge(375, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(153, 376, 1.0); + rank.add_edge(183, 3, 1.0); + rank.add_edge(289, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(124, 377, 1.0); + rank.add_edge(239, 187, 3.0); + rank.add_edge(9, 260, 3.0); + rank.get_new_nodeid(); + rank.add_edge(378, 3, 1.0); + rank.add_edge(12, 21, 1.0); + rank.add_edge(118, 117, 1.0); + rank.get_new_nodeid(); + rank.add_edge(379, 3, 1.0); + rank.add_edge(261, 153, 1.0); + rank.add_edge(21, 202, 6.0); + rank.get_new_nodeid(); + rank.add_edge(380, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(381, 3, 1.0); + rank.add_edge(174, 120, 1.0); + rank.add_edge(93, 46, 3.0); + rank.get_new_nodeid(); + rank.add_edge(382, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(114, 383, 1.0); + rank.add_edge(149, 317, 1.0); + rank.add_edge(194, 50, 1.0); + rank.get_new_nodeid(); + rank.add_edge(384, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(385, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(386, 3, 1.0); + rank.add_edge(142, 3, 1.0); + rank.add_edge(286, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(107, 387, 1.0); + rank.add_edge(6, 4, 1.0); + rank.add_edge(237, 120, 1.0); + rank.add_edge(46, 113, 1.0); + rank.add_edge(376, 153, 1.0); + rank.add_edge(47, 173, 1.0); + rank.add_edge(13, 320, -1.0); + rank.get_new_nodeid(); + rank.add_edge(388, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(389, 59, 1.0); + rank.add_edge(97, 204, 1.0); + rank.get_new_nodeid(); + rank.add_edge(390, 3, 1.0); + rank.add_edge(13, 172, -1.0); + rank.get_new_nodeid(); + rank.add_edge(391, 62, 1.0); + rank.add_edge(21, 72, 5.0); + rank.add_edge(9, 6, 1.0); + rank.add_edge(50, 223, 1.0); + rank.add_edge(97, 115, -1.0); + rank.get_new_nodeid(); + rank.add_edge(392, 3, 1.0); + rank.add_edge(9, 84, 1.0); + rank.get_new_nodeid(); + rank.add_edge(393, 3, 1.0); + rank.add_edge(13, 103, -1.0); + rank.add_edge(14, 70, 1.0); + rank.get_new_nodeid(); + rank.add_edge(4, 394, 8.0); + rank.add_edge(9, 237, 3.0); + rank.add_edge(257, 24, -4.0); + rank.get_new_nodeid(); + rank.add_edge(53, 395, 1.0); + rank.add_edge(63, 241, 1.0); + rank.add_edge(159, 3, 1.0); + rank.add_edge(13, 0, 1.0); + rank.add_edge(44, 357, 1.0); + rank.get_new_nodeid(); + rank.add_edge(396, 336, 1.0); + rank.add_edge(184, 183, 1.0); + rank.add_edge(31, 134, 3.0); + rank.add_edge(108, 51, 3.0); + rank.add_edge(120, 3, 1.0); + rank.add_edge(228, 3, 1.0); + rank.add_edge(113, 139, 3.0); + rank.get_new_nodeid(); + rank.add_edge(397, 3, 1.0); + rank.add_edge(154, 97, 1.0); + rank.get_new_nodeid(); + rank.add_edge(270, 398, 1.0); + rank.add_edge(13, 191, -1.0); + rank.get_new_nodeid(); + rank.add_edge(399, 65, 1.0); + rank.add_edge(50, 131, 9.0); + rank.add_edge(104, 112, 3.0); + rank.add_edge(13, 383, -1.0); + rank.get_new_nodeid(); + rank.add_edge(400, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(401, 53, 1.0); + rank.add_edge(31, 175, -1.0); + rank.add_edge(113, 208, -1.0); + rank.add_edge(53, 242, 1.0); + rank.add_edge(128, 85, 1.0); + rank.get_new_nodeid(); + rank.add_edge(402, 3, 1.0); + rank.add_edge(42, 3, 1.0); + rank.add_edge(104, 47, -1.0); + rank.get_new_nodeid(); + rank.add_edge(403, 3, 1.0); + rank.add_edge(110, 298, 1.0); + rank.add_edge(97, 340, 3.0); + rank.get_new_nodeid(); + rank.add_edge(404, 3, 1.0); + rank.add_edge(9, 142, 1.0); + rank.get_new_nodeid(); + rank.add_edge(336, 405, 1.0); + rank.add_edge(94, 398, 1.0); + rank.add_edge(124, 35, 0.0); + rank.add_edge(68, 320, 1.0); + rank.add_edge(377, 124, 1.0); + rank.add_edge(56, 135, 1.0); + rank.add_edge(76, 112, 1.0); + rank.add_edge(42, 175, 5.0); + rank.get_new_nodeid(); + rank.add_edge(406, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(407, 3, 1.0); + rank.add_edge(53, 3, 1.0); + rank.add_edge(13, 165, 1.0); + rank.add_edge(9, 103, -1.0); + rank.add_edge(59, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(93, 408, 1.0); + rank.get_new_nodeid(); + rank.add_edge(409, 59, 1.0); + rank.get_new_nodeid(); + rank.add_edge(410, 3, 1.0); + rank.add_edge(206, 27, 1.0); + rank.add_edge(70, 250, -1.0); + rank.add_edge(35, 161, 2.0); + rank.add_edge(31, 83, 1.0); + rank.get_new_nodeid(); + rank.add_edge(411, 3, 1.0); + rank.add_edge(21, 394, 1.0); + rank.add_edge(150, 231, 1.0); + rank.get_new_nodeid(); + rank.add_edge(412, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(413, 3, 1.0); + rank.add_edge(21, 51, 1.0); + rank.add_edge(50, 246, 3.0); + rank.add_edge(239, 139, 1.0); + rank.get_new_nodeid(); + rank.add_edge(414, 3, 1.0); + rank.add_edge(27, 24, 1.0); + rank.add_edge(21, 191, 9.0); + rank.add_edge(107, 175, -1.0); + rank.get_new_nodeid(); + rank.add_edge(415, 3, 1.0); + rank.add_edge(31, 251, -1.0); + rank.add_edge(186, 3, 1.0); + rank.add_edge(48, 240, 1.0); + rank.add_edge(39, 112, 8.0); + rank.get_new_nodeid(); + rank.add_edge(416, 3, 1.0); + rank.add_edge(76, 3, 1.0); + rank.add_edge(66, 65, 1.0); + rank.get_new_nodeid(); + rank.add_edge(417, 3, 1.0); + rank.add_edge(132, 3, 1.0); + rank.add_edge(13, 115, -1.0); + rank.add_edge(27, 35, 1.0); + rank.add_edge(42, 72, 4.0); + rank.get_new_nodeid(); + rank.add_edge(418, 3, 1.0); + rank.add_edge(307, 306, 1.0); + rank.add_edge(35, 173, -1.0); + rank.add_edge(4, 191, 6.0); + rank.add_edge(9, 383, -1.0); + rank.add_edge(145, 168, 1.0); + rank.add_edge(110, 115, -1.0); + rank.add_edge(4, 145, 1.0); + rank.get_new_nodeid(); + rank.add_edge(419, 3, 1.0); + rank.add_edge(104, 50, 1.0); + rank.add_edge(31, 54, 1.0); + rank.add_edge(44, 277, 1.0); + rank.get_new_nodeid(); + rank.add_edge(420, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(421, 3, 1.0); + rank.add_edge(272, 252, 3.0); + rank.add_edge(70, 5, 2.0); + rank.add_edge(35, 308, 1.0); + rank.add_edge(343, 24, 0.0); + rank.add_edge(328, 9, 1.0); + rank.get_new_nodeid(); + rank.add_edge(422, 3, 1.0); + rank.add_edge(0, 46, 1.0); + rank.add_edge(104, 374, 5.0); + rank.add_edge(90, 24, 0.0); + rank.add_edge(59, 389, 1.0); + rank.get_new_nodeid(); + rank.add_edge(423, 3, 1.0); + rank.add_edge(212, 113, 1.0); + rank.add_edge(13, 173, -1.0); + rank.get_new_nodeid(); + rank.add_edge(424, 3, 1.0); + rank.add_edge(30, 331, 1.0); + rank.add_edge(27, 309, 1.0); + rank.get_new_nodeid(); + rank.add_edge(425, 3, 1.0); + rank.add_edge(30, 75, 3.0); + rank.add_edge(97, 1, 7.0); + rank.add_edge(84, 7, 1.0); + rank.get_new_nodeid(); + rank.add_edge(426, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(427, 3, 1.0); + rank.add_edge(117, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 428, 1.0); + rank.add_edge(1, 21, 1.0); + rank.add_edge(76, 75, 1.0); + rank.add_edge(309, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(429, 3, 1.0); + rank.add_edge(31, 115, -1.0); + rank.add_edge(18, 372, 1.0); + rank.add_edge(394, 21, 1.0); + rank.add_edge(259, 363, 1.0); + rank.add_edge(221, 338, 1.0); + rank.get_new_nodeid(); + rank.add_edge(430, 3, 1.0); + rank.add_edge(35, 341, 1.0); + rank.add_edge(162, 14, 2.0); + rank.add_edge(270, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(431, 3, 1.0); + rank.add_edge(70, 48, 1.0); + rank.add_edge(263, 3, 1.0); + rank.add_edge(97, 154, 1.0); + rank.add_edge(21, 340, 9.0); + rank.add_edge(9, 173, -1.0); + rank.add_edge(35, 100, -1.0); + rank.add_edge(162, 374, 6.0); + rank.add_edge(324, 113, 1.0); + rank.add_edge(182, 181, 1.0); + rank.add_edge(251, 48, 1.0); + rank.add_edge(5, 48, 1.0); + rank.add_edge(326, 69, 1.0); + rank.add_edge(316, 79, 1.0); + rank.add_edge(162, 115, 3.0); + rank.add_edge(162, 278, 1.0); + rank.add_edge(50, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(30, 432, 1.0); + rank.add_edge(84, 274, 1.0); + rank.get_new_nodeid(); + rank.add_edge(433, 3, 1.0); + rank.add_edge(47, 6, 1.0); + rank.add_edge(68, 24, 3.0); + rank.add_edge(191, 21, 1.0); + rank.add_edge(105, 24, 0.0); + rank.get_new_nodeid(); + rank.add_edge(434, 3, 1.0); + rank.add_edge(4, 202, 1.0); + rank.add_edge(19, 111, -1.0); + rank.add_edge(31, 113, 1.0); + rank.get_new_nodeid(); + rank.add_edge(435, 3, 1.0); + rank.add_edge(230, 229, 1.0); + rank.add_edge(341, 27, 1.0); + rank.add_edge(42, 134, 1.0); + rank.add_edge(258, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(221, 436, 1.0); + rank.add_edge(93, 361, 1.0); + rank.add_edge(9, 174, 3.0); + rank.add_edge(62, 391, 1.0); + rank.add_edge(19, 278, 4.0); + rank.add_edge(35, 7, -1.0); + rank.get_new_nodeid(); + rank.add_edge(45, 437, 1.0); + rank.get_new_nodeid(); + rank.add_edge(438, 289, 1.0); + rank.get_new_nodeid(); + rank.add_edge(439, 3, 1.0); + rank.add_edge(54, 53, 1.0); + rank.get_new_nodeid(); + rank.add_edge(440, 3, 1.0); + rank.add_edge(107, 1, 1.0); + rank.add_edge(0, 3, 1.0); + rank.add_edge(39, 241, 1.0); + rank.add_edge(374, 145, 1.0); + rank.add_edge(13, 7, -1.0); + rank.add_edge(31, 204, -1.0); + rank.add_edge(12, 146, 8.0); + rank.add_edge(113, 172, 8.0); + rank.add_edge(149, 46, 5.0); + rank.add_edge(31, 304, 1.0); + rank.add_edge(120, 119, 1.0); + rank.get_new_nodeid(); + rank.add_edge(441, 3, 1.0); + rank.add_edge(31, 359, 1.0); + rank.get_new_nodeid(); + rank.add_edge(442, 3, 1.0); + rank.add_edge(230, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(443, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(444, 3, 1.0); + rank.add_edge(30, 21, 1.0); + rank.add_edge(145, 374, 1.0); + rank.add_edge(13, 185, 1.0); + rank.add_edge(139, 18, 1.0); + rank.add_edge(310, 280, 1.0); + rank.add_edge(339, 27, 1.0); + rank.add_edge(4, 154, 4.0); + rank.get_new_nodeid(); + rank.add_edge(48, 445, 1.0); + rank.add_edge(408, 93, 1.0); + rank.get_new_nodeid(); + rank.add_edge(446, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(447, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(448, 3, 1.0); + rank.add_edge(111, 6, 1.0); + rank.add_edge(13, 3, 1.0); + rank.add_edge(48, 326, 4.0); + rank.add_edge(239, 176, 3.0); + rank.get_new_nodeid(); + rank.add_edge(35, 449, 1.0); + rank.add_edge(331, 30, 1.0); + rank.add_edge(19, 3, 1.0); + rank.add_edge(13, 156, -1.0); + rank.add_edge(156, 6, 1.0); + rank.add_edge(145, 251, 8.0); + rank.add_edge(110, 252, 5.0); + rank.add_edge(13, 24, 2.0); + rank.add_edge(107, 3, 1.0); + rank.add_edge(63, 1, 1.0); + rank.get_new_nodeid(); + rank.add_edge(450, 90, 1.0); + rank.get_new_nodeid(); + rank.add_edge(451, 3, 1.0); + rank.add_edge(360, 42, 1.0); + rank.add_edge(6, 3, 1.0); + rank.add_edge(59, 24, 1.0); + rank.add_edge(13, 208, 2.0); + rank.add_edge(82, 32, 1.0); + rank.get_new_nodeid(); + rank.add_edge(105, 452, 1.0); + rank.add_edge(124, 3, 1.0); + rank.add_edge(78, 3, 1.0); + rank.add_edge(163, 251, 1.0); + rank.add_edge(428, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(275, 453, 1.0); + rank.add_edge(278, 162, 1.0); + rank.add_edge(9, 1, -1.0); + rank.get_new_nodeid(); + rank.add_edge(454, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(455, 280, 1.0); + rank.add_edge(35, 339, 1.0); + rank.add_edge(432, 30, 1.0); + rank.add_edge(288, 24, 1.0); + rank.add_edge(252, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(456, 46, 4.0); + rank.get_new_nodeid(); + rank.add_edge(457, 3, 1.0); + rank.add_edge(181, 3, 1.0); + rank.add_edge(153, 261, 1.0); + rank.add_edge(255, 46, 2.0); + rank.get_new_nodeid(); + rank.add_edge(141, 458, 1.0); + rank.add_edge(35, 176, 1.0); + rank.add_edge(162, 261, 8.0); + rank.add_edge(31, 139, 1.0); + rank.add_edge(9, 113, 1.0); + rank.get_new_nodeid(); + rank.add_edge(459, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(460, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(306, 461, 1.0); + rank.add_edge(63, 168, 0.0); + rank.get_new_nodeid(); + rank.add_edge(186, 462, 1.0); + rank.add_edge(308, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(463, 3, 1.0); + rank.add_edge(47, 20, 3.0); + rank.add_edge(76, 137, 8.0); + rank.get_new_nodeid(); + rank.add_edge(464, 3, 1.0); + rank.add_edge(153, 115, 2.0); + rank.add_edge(31, 173, -1.0); + rank.add_edge(9, 3, 1.0); + rank.add_edge(9, 246, 1.0); + rank.add_edge(31, 0, 1.0); + rank.add_edge(142, 205, 1.0); + rank.get_new_nodeid(); + rank.add_edge(465, 3, 1.0); + rank.add_edge(9, 115, -1.0); + rank.add_edge(13, 35, 1.0); + rank.add_edge(84, 331, 3.0); + rank.add_edge(13, 231, -1.0); + rank.get_new_nodeid(); + rank.add_edge(466, 3, 1.0); + rank.add_edge(452, 105, 1.0); + rank.get_new_nodeid(); + rank.add_edge(467, 3, 1.0); + rank.add_edge(356, 7, -3.0); + rank.get_new_nodeid(); + rank.add_edge(69, 468, 1.0); + rank.add_edge(82, 208, 1.0); + rank.add_edge(42, 24, -6.0); + rank.get_new_nodeid(); + rank.add_edge(469, 3, 1.0); + rank.add_edge(159, 158, 1.0); + rank.add_edge(19, 250, 4.0); + rank.add_edge(6, 84, 1.0); + rank.get_new_nodeid(); + rank.add_edge(470, 93, 1.0); + rank.add_edge(35, 172, -1.0); + rank.add_edge(9, 205, 4.0); + rank.get_new_nodeid(); + rank.add_edge(471, 3, 1.0); + rank.add_edge(27, 208, 1.0); + rank.add_edge(90, 3, 1.0); + rank.add_edge(102, 9, 1.0); + rank.add_edge(239, 34, 2.0); + rank.get_new_nodeid(); + rank.add_edge(472, 3, 1.0); + rank.add_edge(102, 32, 4.0); + rank.add_edge(31, 24, 1.0); + rank.add_edge(284, 95, 1.0); + rank.add_edge(9, 286, 1.0); + rank.add_edge(320, 68, 1.0); + rank.add_edge(77, 225, 1.0); + rank.get_new_nodeid(); + rank.add_edge(473, 3, 1.0); + rank.add_edge(19, 1, 8.0); + rank.add_edge(275, 329, 1.0); + rank.add_edge(39, 175, 1.0); + rank.get_new_nodeid(); + rank.add_edge(474, 24, 6.0); + rank.add_edge(398, 270, 1.0); + rank.get_new_nodeid(); + rank.add_edge(475, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(476, 3, 1.0); + rank.add_edge(27, 347, 1.0); + rank.get_new_nodeid(); + rank.add_edge(477, 3, 1.0); + rank.add_edge(387, 107, 1.0); + rank.add_edge(395, 53, 1.0); + rank.get_new_nodeid(); + rank.add_edge(478, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(479, 3, 1.0); + rank.add_edge(6, 35, 1.0); + rank.add_edge(13, 251, -1.0); + rank.add_edge(165, 35, 1.0); + rank.add_edge(159, 301, 1.0); + rank.add_edge(456, 3, 1.0); + rank.add_edge(280, 455, 1.0); + rank.add_edge(9, 149, 1.0); + rank.add_edge(461, 306, 1.0); + rank.add_edge(35, 208, 3.0); + rank.add_edge(21, 369, 1.0); + rank.add_edge(162, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(480, 3, 1.0); + rank.add_edge(59, 409, 1.0); + rank.add_edge(21, 35, 1.0); + rank.add_edge(65, 399, 1.0); + rank.get_new_nodeid(); + rank.add_edge(481, 3, 1.0); + rank.add_edge(257, 46, 4.0); + rank.add_edge(256, 255, 1.0); + rank.add_edge(458, 141, 1.0); + rank.add_edge(239, 24, 2.0); + rank.add_edge(354, 101, 1.0); + rank.add_edge(436, 221, 1.0); + rank.get_new_nodeid(); + rank.add_edge(482, 3, 1.0); + rank.add_edge(113, 34, 5.0); + rank.add_edge(9, 51, -1.0); + rank.add_edge(272, 3, 1.0); + rank.add_edge(35, 286, 2.0); + rank.get_new_nodeid(); + rank.add_edge(483, 3, 1.0); + rank.add_edge(405, 336, 1.0); + rank.add_edge(90, 450, 1.0); + rank.get_new_nodeid(); + rank.add_edge(484, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(485, 3, 1.0); + rank.add_edge(39, 3, 1.0); + rank.add_edge(97, 35, 1.0); + rank.add_edge(19, 100, 1.0); + rank.get_new_nodeid(); + rank.add_edge(27, 486, 1.0); + rank.add_edge(153, 250, 1.0); + rank.add_edge(35, 51, -1.0); + rank.get_new_nodeid(); + rank.add_edge(487, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(488, 3, 1.0); + rank.add_edge(7, 84, 1.0); + rank.add_edge(9, 304, 3.0); + rank.add_edge(48, 88, 1.0); + rank.add_edge(163, 241, -1.0); + rank.get_new_nodeid(); + rank.add_edge(489, 3, 1.0); + rank.add_edge(210, 3, 1.0); + rank.add_edge(9, 373, 1.0); + rank.add_edge(202, 4, 1.0); + rank.add_edge(50, 369, 7.0); + rank.add_edge(153, 1, 9.0); + rank.get_new_nodeid(); + rank.add_edge(490, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(491, 3, 1.0); + rank.add_edge(9, 72, -1.0); + rank.get_new_nodeid(); + rank.add_edge(492, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(493, 3, 1.0); + rank.add_edge(108, 7, -4.0); + rank.add_edge(48, 376, 5.0); + rank.get_new_nodeid(); + rank.add_edge(494, 3, 1.0); + rank.add_edge(145, 21, 1.0); + rank.add_edge(168, 145, 1.0); + rank.add_edge(4, 75, -1.0); + rank.add_edge(82, 304, 1.0); + rank.add_edge(289, 438, 1.0); + rank.add_edge(93, 470, 1.0); + rank.add_edge(13, 205, 1.0); + rank.add_edge(192, 3, 1.0); + rank.add_edge(30, 146, 6.0); + rank.add_edge(186, 17, 1.0); + rank.add_edge(84, 223, 5.0); + rank.add_edge(76, 7, 9.0); + rank.add_edge(215, 3, 1.0); + rank.add_edge(4, 146, 1.0); + rank.add_edge(360, 134, 1.0); + rank.add_edge(76, 6, 1.0); + rank.add_edge(13, 72, -1.0); + rank.add_edge(31, 10, 1.0); + rank.add_edge(453, 275, 1.0); + rank.add_edge(96, 93, 1.0); + rank.add_edge(35, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(495, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(496, 3, 1.0); + rank.add_edge(85, 24, 0.0); + rank.add_edge(228, 205, 1.0); + rank.add_edge(93, 92, 1.0); + rank.get_new_nodeid(); + rank.add_edge(497, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(498, 3, 1.0); + rank.add_edge(186, 243, 1.0); + rank.add_edge(53, 260, 1.0); + rank.add_edge(152, 151, 1.0); + rank.add_edge(9, 249, -1.0); + rank.get_new_nodeid(); + rank.add_edge(499, 3, 1.0); + rank.add_edge(180, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(500, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(501, 151, 1.0); + rank.get_new_nodeid(); + rank.add_edge(502, 3, 1.0); + rank.add_edge(474, 3, 1.0); + rank.add_edge(445, 48, 1.0); + rank.add_edge(9, 119, 3.0); + rank.add_edge(257, 3, 1.0); + rank.add_edge(97, 147, 4.0); + rank.add_edge(19, 112, -1.0); + rank.add_edge(90, 266, 1.0); + rank.add_edge(31, 205, 1.0); + rank.add_edge(69, 48, 1.0); + rank.get_new_nodeid(); + rank.add_edge(151, 503, 1.0); + rank.add_edge(4, 374, 2.0); + rank.add_edge(190, 3, 1.0); + rank.add_edge(84, 194, 6.0); + rank.add_edge(4, 223, 1.0); + rank.get_new_nodeid(); + rank.add_edge(504, 3, 1.0); + rank.add_edge(449, 35, 1.0); + rank.add_edge(221, 24, 1.0); + rank.add_edge(69, 171, 8.0); + rank.add_edge(149, 208, 2.0); + rank.get_new_nodeid(); + rank.add_edge(505, 3, 1.0); + rank.add_edge(35, 364, 1.0); + rank.add_edge(30, 137, 5.0); + rank.get_new_nodeid(); + rank.add_edge(506, 3, 1.0); + rank.add_edge(162, 84, 1.0); + rank.get_new_nodeid(); + rank.add_edge(507, 3, 1.0); + rank.add_edge(77, 247, 1.0); + rank.add_edge(13, 32, 1.0); + rank.add_edge(35, 258, 1.0); + rank.get_new_nodeid(); + rank.add_edge(508, 3, 1.0); + rank.add_edge(437, 45, 1.0); + rank.add_edge(462, 186, 1.0); + rank.get_new_nodeid(); + rank.add_edge(509, 3, 1.0); + rank.add_edge(133, 24, -3.0); + rank.get_new_nodeid(); + rank.add_edge(510, 3, 1.0); + rank.add_edge(124, 27, 1.0); + rank.add_edge(383, 114, 1.0); + rank.add_edge(108, 3, 1.0); + rank.add_edge(126, 27, 1.0); + rank.add_edge(486, 27, 1.0); + rank.add_edge(42, 113, 1.0); + rank.add_edge(151, 501, 1.0); + rank.add_edge(270, 95, 7.0); + rank.get_new_nodeid(); + rank.add_edge(77, 511, 1.0); + rank.get_new_nodeid(); + rank.add_edge(512, 3, 1.0); + rank.add_edge(27, 322, 1.0); + rank.get_new_nodeid(); + rank.add_edge(513, 3, 1.0); + rank.add_edge(106, 105, 1.0); + rank.add_edge(12, 115, 1.0); + rank.add_edge(317, 149, 1.0); + rank.get_new_nodeid(); + rank.add_edge(514, 3, 1.0); + rank.add_edge(31, 228, 1.0); + rank.get_new_nodeid(); + rank.add_edge(515, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(516, 3, 1.0); + rank.add_edge(97, 3, 1.0); + rank.add_edge(254, 145, 1.0); + rank.add_edge(102, 3, 1.0); + rank.add_edge(153, 147, 1.0); + rank.add_edge(162, 147, 5.0); + rank.add_edge(153, 20, -1.0); + rank.get_new_nodeid(); + rank.add_edge(517, 3, 1.0); + rank.add_edge(183, 72, -1.0); + rank.add_edge(44, 208, 0.0); + rank.get_new_nodeid(); + rank.add_edge(518, 3, 1.0); + rank.add_edge(474, 1, -9.0); + rank.add_edge(63, 3, 1.0); + rank.add_edge(48, 104, 1.0); + rank.add_edge(230, 345, 1.0); + rank.add_edge(149, 148, 1.0); + rank.add_edge(70, 3, 1.0); + rank.add_edge(59, 17, -1.0); + rank.add_edge(105, 123, 1.0); + rank.get_new_nodeid(); + rank.add_edge(10, 519, 1.0); + rank.add_edge(34, 47, 1.0); + rank.add_edge(223, 50, 1.0); + rank.add_edge(12, 331, 6.0); + rank.add_edge(145, 326, 1.0); + rank.add_edge(97, 340, 1.0); + rank.add_edge(137, 21, 1.0); + rank.add_edge(23, 1, 0.0); + rank.add_edge(31, 46, 1.0); + rank.get_new_nodeid(); + rank.add_edge(520, 3, 1.0); + rank.add_edge(4, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(521, 3, 1.0); + rank.add_edge(219, 1, 1.0); + rank.get_new_nodeid(); + rank.add_edge(522, 3, 1.0); + rank.add_edge(22, 21, 1.0); + rank.add_edge(51, 84, 1.0); + rank.add_edge(113, 324, 1.0); + rank.add_edge(519, 3, 1.0); + rank.add_edge(53, 401, 1.0); + rank.add_edge(171, 70, 1.0); + rank.add_edge(468, 69, 1.0); + rank.add_edge(47, 34, 1.0); + rank.add_edge(163, 1, -2.0); + rank.get_new_nodeid(); + rank.add_edge(523, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(524, 3, 1.0); + rank.add_edge(90, 89, 1.0); + rank.add_edge(153, 5, 8.0); + rank.add_edge(9, 172, -1.0); + rank.add_edge(36, 3, 1.0); + rank.add_edge(93, 269, 1.0); + rank.add_edge(9, 233, 1.0); + rank.add_edge(511, 77, 1.0); + rank.add_edge(84, 30, 1.0); + rank.add_edge(94, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(525, 3, 1.0); + rank.add_edge(170, 27, 1.0); + rank.get_new_nodeid(); + rank.add_edge(526, 3, 1.0); + rank.add_edge(173, 12, 1.0); + rank.add_edge(30, 204, 5.0); + rank.get_new_nodeid(); + rank.add_edge(527, 3, 1.0); + rank.add_edge(42, 7, 2.0); + rank.get_new_nodeid(); + rank.add_edge(528, 3, 1.0); + rank.add_edge(9, 161, 3.0); + rank.add_edge(17, 186, 1.0); + rank.get_new_nodeid(); + rank.add_edge(529, 3, 1.0); + rank.add_edge(9, 49, 1.0); + rank.add_edge(48, 251, 1.0); + rank.add_edge(6, 156, 1.0); + rank.get_new_nodeid(); + rank.add_edge(530, 3, 1.0); + rank.add_edge(210, 209, 1.0); + rank.add_edge(110, 17, -1.0); + rank.add_edge(131, 48, 1.0); + rank.add_edge(31, 208, 1.0); + rank.add_edge(259, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(531, 3, 1.0); + rank.add_edge(187, 186, 1.0); + rank.add_edge(157, 0, 1.0); + rank.add_edge(519, 10, 1.0); + rank.add_edge(39, 241, 6.0); + rank.add_edge(159, 302, 1.0); + rank.get_new_nodeid(); + rank.add_edge(532, 3, 1.0); + rank.add_edge(74, 73, 1.0); + rank.get_new_nodeid(); + rank.add_edge(533, 3, 1.0); + rank.add_edge(336, 396, 1.0); + rank.get_new_nodeid(); + rank.add_edge(534, 3, 1.0); + rank.get_new_nodeid(); + rank.add_edge(535, 3, 1.0); + rank.add_edge(503, 151, 1.0); + rank.add_edge(337, 336, 1.0); + rank.add_edge(120, 174, 1.0); + rank.add_edge(48, 254, 6.0); + rank.get_new_nodeid(); + rank.add_edge(536, 3, 1.0); + rank.add_edge(268, 93, 1.0); + rank.add_edge(292, 27, 1.0); + rank.add_edge(9, 231, -1.0); + rank.add_edge(27, 311, 1.0); + rank.add_edge(369, 21, 1.0); + rank.add_edge(524, 7, -2.0); + rank.get_new_nodeid(); + rank.add_edge(537, 3, 1.0); + rank.add_edge(48, 175, 3.0); + rank.add_edge(9, 191, -1.0); + rank.add_edge(110, 64, 3.0); + rank.calculate(253, 100).unwrap(); + rank.calculate(299, 100).unwrap(); + rank.calculate(407, 100).unwrap(); + rank.calculate(433, 100).unwrap(); + rank.calculate(312, 100).unwrap(); + rank.calculate(477, 100).unwrap(); + rank.calculate(45, 100).unwrap(); + rank.calculate(508, 100).unwrap(); + rank.calculate(102, 100).unwrap(); + rank.calculate(287, 100).unwrap(); + rank.calculate(124, 100).unwrap(); + rank.calculate(356, 100).unwrap(); + rank.calculate(507, 100).unwrap(); + rank.calculate(523, 100).unwrap(); + rank.calculate(332, 100).unwrap(); + rank.calculate(355, 100).unwrap(); + rank.calculate(367, 100).unwrap(); + rank.calculate(370, 100).unwrap(); + rank.calculate(527, 100).unwrap(); + rank.calculate(245, 100).unwrap(); + rank.calculate(238, 100).unwrap(); + rank.calculate(413, 100).unwrap(); + rank.calculate(108, 100).unwrap(); + rank.calculate(122, 100).unwrap(); + rank.calculate(518, 100).unwrap(); + rank.calculate(443, 100).unwrap(); + rank.calculate(439, 100).unwrap(); + rank.calculate(429, 100).unwrap(); + rank.calculate(321, 100).unwrap(); + rank.calculate(97, 100).unwrap(); + rank.calculate(162, 100).unwrap(); + rank.calculate(488, 100).unwrap(); + rank.calculate(44, 100).unwrap(); + rank.calculate(465, 100).unwrap(); + rank.calculate(368, 100).unwrap(); + rank.calculate(446, 100).unwrap(); + rank.calculate(365, 100).unwrap(); + rank.calculate(239, 100).unwrap(); + rank.calculate(371, 100).unwrap(); + rank.calculate(485, 100).unwrap(); + rank.calculate(334, 100).unwrap(); + rank.calculate(199, 100).unwrap(); + rank.calculate(525, 100).unwrap(); + rank.calculate(179, 100).unwrap(); + rank.calculate(18, 100).unwrap(); + rank.calculate(404, 100).unwrap(); + rank.calculate(6, 100).unwrap(); + rank.calculate(0, 100).unwrap(); + rank.calculate(416, 100).unwrap(); + rank.calculate(495, 100).unwrap(); + rank.calculate(160, 100).unwrap(); + rank.calculate(351, 100).unwrap(); + rank.calculate(169, 100).unwrap(); + rank.calculate(214, 100).unwrap(); + rank.calculate(295, 100).unwrap(); + rank.calculate(291, 100).unwrap(); + rank.calculate(30, 100).unwrap(); + rank.calculate(55, 100).unwrap(); + rank.calculate(530, 100).unwrap(); + rank.calculate(164, 100).unwrap(); + rank.calculate(535, 100).unwrap(); + rank.calculate(94, 100).unwrap(); + rank.calculate(516, 100).unwrap(); + rank.calculate(419, 100).unwrap(); + rank.calculate(366, 100).unwrap(); + rank.calculate(235, 100).unwrap(); + rank.calculate(273, 100).unwrap(); + rank.calculate(188, 100).unwrap(); + rank.calculate(192, 100).unwrap(); + rank.calculate(167, 100).unwrap(); + rank.calculate(360, 100).unwrap(); + rank.calculate(412, 100).unwrap(); + rank.calculate(381, 100).unwrap(); + rank.calculate(352, 100).unwrap(); + rank.calculate(482, 100).unwrap(); + rank.calculate(318, 100).unwrap(); + rank.calculate(210, 100).unwrap(); + rank.calculate(424, 100).unwrap(); + rank.calculate(379, 100).unwrap(); + rank.calculate(358, 100).unwrap(); + rank.calculate(4, 100).unwrap(); + rank.calculate(101, 100).unwrap(); + rank.calculate(31, 100).unwrap(); + rank.calculate(496, 100).unwrap(); + rank.calculate(457, 100).unwrap(); + rank.calculate(16, 100).unwrap(); + rank.calculate(313, 100).unwrap(); + rank.calculate(382, 100).unwrap(); + rank.calculate(490, 100).unwrap(); + rank.calculate(435, 100).unwrap(); + rank.calculate(484, 100).unwrap(); + rank.calculate(375, 100).unwrap(); + rank.calculate(166, 100).unwrap(); + rank.calculate(144, 100).unwrap(); + rank.calculate(78, 100).unwrap(); + rank.calculate(289, 100).unwrap(); + rank.calculate(533, 100).unwrap(); + rank.calculate(190, 100).unwrap(); + rank.calculate(136, 100).unwrap(); + rank.calculate(276, 100).unwrap(); + rank.calculate(293, 100).unwrap(); + rank.calculate(519, 100).unwrap(); + rank.calculate(43, 100).unwrap(); + rank.calculate(201, 100).unwrap(); + rank.calculate(406, 100).unwrap(); + rank.calculate(521, 100).unwrap(); + rank.calculate(13, 100).unwrap(); + rank.calculate(515, 100).unwrap(); + rank.calculate(491, 100).unwrap(); + rank.calculate(74, 100).unwrap(); + rank.calculate(41, 100).unwrap(); + rank.calculate(335, 100).unwrap(); + rank.calculate(230, 100).unwrap(); + rank.calculate(56, 100).unwrap(); + rank.calculate(8, 100).unwrap(); + rank.calculate(265, 100).unwrap(); + rank.calculate(336, 100).unwrap(); + rank.calculate(42, 100).unwrap(); + rank.calculate(93, 100).unwrap(); + rank.calculate(300, 100).unwrap(); + rank.calculate(178, 100).unwrap(); + rank.calculate(84, 100).unwrap(); + rank.calculate(35, 100).unwrap(); + rank.calculate(40, 100).unwrap(); + rank.calculate(143, 100).unwrap(); + rank.calculate(514, 100).unwrap(); + rank.calculate(127, 100).unwrap(); + rank.calculate(130, 100).unwrap(); + rank.calculate(466, 100).unwrap(); + rank.calculate(493, 100).unwrap(); + rank.calculate(183, 100).unwrap(); + rank.calculate(50, 100).unwrap(); + rank.calculate(58, 100).unwrap(); + rank.calculate(263, 100).unwrap(); + rank.calculate(476, 100).unwrap(); + rank.calculate(79, 100).unwrap(); + rank.calculate(217, 100).unwrap(); + rank.calculate(177, 100).unwrap(); + rank.calculate(315, 100).unwrap(); + rank.calculate(248, 100).unwrap(); + rank.calculate(502, 100).unwrap(); + rank.calculate(267, 100).unwrap(); + rank.calculate(510, 100).unwrap(); + rank.calculate(228, 100).unwrap(); + rank.calculate(442, 100).unwrap(); + rank.calculate(65, 100).unwrap(); + rank.calculate(70, 100).unwrap(); + rank.calculate(203, 100).unwrap(); + rank.calculate(319, 100).unwrap(); + rank.calculate(62, 100).unwrap(); + rank.calculate(378, 100).unwrap(); + rank.calculate(423, 100).unwrap(); + rank.calculate(444, 100).unwrap(); + rank.calculate(471, 100).unwrap(); + rank.calculate(480, 100).unwrap(); + rank.calculate(151, 100).unwrap(); + rank.calculate(282, 100).unwrap(); + rank.calculate(489, 100).unwrap(); + rank.calculate(21, 100).unwrap(); + rank.calculate(141, 100).unwrap(); + rank.calculate(114, 100).unwrap(); + rank.calculate(59, 100).unwrap(); + rank.calculate(306, 100).unwrap(); + rank.calculate(325, 100).unwrap(); + rank.calculate(219, 100).unwrap(); + rank.calculate(280, 100).unwrap(); + rank.calculate(57, 100).unwrap(); + rank.calculate(221, 100).unwrap(); + rank.calculate(506, 100).unwrap(); + rank.calculate(410, 100).unwrap(); + rank.calculate(67, 100).unwrap(); + rank.calculate(91, 100).unwrap(); + rank.calculate(113, 100).unwrap(); + rank.calculate(425, 100).unwrap(); + rank.calculate(198, 100).unwrap(); + rank.calculate(272, 100).unwrap(); + rank.calculate(353, 100).unwrap(); + rank.calculate(451, 100).unwrap(); + rank.calculate(494, 100).unwrap(); + rank.calculate(456, 100).unwrap(); + rank.calculate(513, 100).unwrap(); + rank.calculate(53, 100).unwrap(); + rank.calculate(526, 100).unwrap(); + rank.calculate(420, 100).unwrap(); + rank.calculate(80, 100).unwrap(); + rank.calculate(2, 100).unwrap(); + rank.calculate(498, 100).unwrap(); + rank.calculate(499, 100).unwrap(); + rank.calculate(509, 100).unwrap(); + rank.calculate(186, 100).unwrap(); + rank.calculate(234, 100).unwrap(); + rank.calculate(430, 100).unwrap(); + rank.calculate(224, 100).unwrap(); + rank.calculate(222, 100).unwrap(); + rank.calculate(28, 100).unwrap(); + rank.calculate(415, 100).unwrap(); + rank.calculate(447, 100).unwrap(); + rank.calculate(257, 100).unwrap(); + rank.calculate(427, 100).unwrap(); + rank.calculate(487, 100).unwrap(); + rank.calculate(180, 100).unwrap(); + rank.calculate(133, 100).unwrap(); + rank.calculate(417, 100).unwrap(); + rank.calculate(532, 100).unwrap(); + rank.calculate(524, 100).unwrap(); + rank.calculate(483, 100).unwrap(); + rank.calculate(297, 100).unwrap(); + rank.calculate(68, 100).unwrap(); + rank.calculate(226, 100).unwrap(); + rank.calculate(463, 100).unwrap(); + rank.calculate(99, 100).unwrap(); + rank.calculate(403, 100).unwrap(); + rank.calculate(441, 100).unwrap(); + rank.calculate(77, 100).unwrap(); + rank.calculate(85, 100).unwrap(); + rank.calculate(348, 100).unwrap(); + rank.calculate(504, 100).unwrap(); + rank.calculate(12, 100).unwrap(); + rank.calculate(388, 100).unwrap(); + rank.calculate(342, 100).unwrap(); + rank.calculate(362, 100).unwrap(); + rank.calculate(534, 100).unwrap(); + rank.calculate(333, 100).unwrap(); + rank.calculate(200, 100).unwrap(); + rank.calculate(384, 100).unwrap(); + rank.calculate(33, 100).unwrap(); + rank.calculate(440, 100).unwrap(); + rank.calculate(475, 100).unwrap(); + rank.calculate(460, 100).unwrap(); + rank.calculate(517, 100).unwrap(); + rank.calculate(255, 100).unwrap(); + rank.calculate(537, 100).unwrap(); + rank.calculate(275, 100).unwrap(); + rank.calculate(145, 100).unwrap(); + rank.calculate(87, 100).unwrap(); + rank.calculate(434, 100).unwrap(); + rank.calculate(39, 100).unwrap(); + rank.calculate(262, 100).unwrap(); + rank.calculate(285, 100).unwrap(); + rank.calculate(469, 100).unwrap(); + rank.calculate(390, 100).unwrap(); + rank.calculate(343, 100).unwrap(); + rank.calculate(36, 100).unwrap(); + rank.calculate(52, 100).unwrap(); + rank.calculate(90, 100).unwrap(); + rank.calculate(15, 100).unwrap(); + rank.calculate(421, 100).unwrap(); + rank.calculate(196, 100).unwrap(); + rank.calculate(163, 100).unwrap(); + rank.calculate(400, 100).unwrap(); + rank.calculate(505, 100).unwrap(); + rank.calculate(422, 100).unwrap(); + rank.calculate(330, 100).unwrap(); + rank.calculate(464, 100).unwrap(); + rank.calculate(11, 100).unwrap(); + rank.calculate(47, 100).unwrap(); + rank.calculate(314, 100).unwrap(); + rank.calculate(76, 100).unwrap(); + rank.calculate(344, 100).unwrap(); + rank.calculate(520, 100).unwrap(); + rank.calculate(459, 100).unwrap(); + rank.calculate(218, 100).unwrap(); + rank.calculate(536, 100).unwrap(); + rank.calculate(492, 100).unwrap(); + rank.calculate(149, 100).unwrap(); + rank.calculate(120, 100).unwrap(); + rank.calculate(323, 100).unwrap(); + rank.calculate(346, 100).unwrap(); + rank.calculate(3, 100).unwrap(); + rank.calculate(104, 100).unwrap(); + rank.calculate(19, 100).unwrap(); + rank.calculate(63, 100).unwrap(); + rank.calculate(107, 100).unwrap(); + rank.calculate(481, 100).unwrap(); + rank.calculate(138, 100).unwrap(); + rank.calculate(23, 100).unwrap(); + rank.calculate(153, 100).unwrap(); + rank.calculate(207, 100).unwrap(); + rank.calculate(411, 100).unwrap(); + rank.calculate(193, 100).unwrap(); + rank.calculate(232, 100).unwrap(); + rank.calculate(327, 100).unwrap(); + rank.calculate(512, 100).unwrap(); + rank.calculate(159, 100).unwrap(); + rank.calculate(105, 100).unwrap(); + rank.calculate(48, 100).unwrap(); + rank.calculate(270, 100).unwrap(); + rank.calculate(9, 100).unwrap(); + rank.calculate(393, 100).unwrap(); + rank.calculate(529, 100).unwrap(); + rank.calculate(350, 100).unwrap(); + rank.calculate(472, 100).unwrap(); + rank.calculate(181, 100).unwrap(); + rank.calculate(380, 100).unwrap(); + rank.calculate(414, 100).unwrap(); + rank.calculate(197, 100).unwrap(); + rank.calculate(189, 100).unwrap(); + rank.calculate(431, 100).unwrap(); + rank.calculate(110, 100).unwrap(); + rank.calculate(284, 100).unwrap(); + rank.calculate(426, 100).unwrap(); + rank.calculate(142, 100).unwrap(); + rank.calculate(259, 100).unwrap(); + rank.calculate(303, 100).unwrap(); + rank.calculate(402, 100).unwrap(); + rank.calculate(211, 100).unwrap(); + rank.calculate(283, 100).unwrap(); + rank.calculate(288, 100).unwrap(); + rank.calculate(392, 100).unwrap(); + rank.calculate(281, 100).unwrap(); + rank.calculate(478, 100).unwrap(); + rank.calculate(215, 100).unwrap(); + rank.calculate(385, 100).unwrap(); + rank.calculate(528, 100).unwrap(); + rank.calculate(82, 100).unwrap(); + rank.calculate(474, 100).unwrap(); + rank.calculate(117, 100).unwrap(); + rank.calculate(418, 100).unwrap(); + rank.calculate(448, 100).unwrap(); + rank.calculate(150, 100).unwrap(); + rank.calculate(132, 100).unwrap(); + rank.calculate(397, 100).unwrap(); + rank.calculate(467, 100).unwrap(); + rank.calculate(473, 100).unwrap(); + rank.calculate(479, 100).unwrap(); + rank.calculate(27, 100).unwrap(); + rank.calculate(29, 100).unwrap(); + rank.calculate(386, 100).unwrap(); + rank.calculate(195, 100).unwrap(); + rank.calculate(497, 100).unwrap(); + rank.calculate(500, 100).unwrap(); + rank.calculate(69, 100).unwrap(); + rank.calculate(531, 100).unwrap(); + rank.calculate(454, 100).unwrap(); + rank.calculate(349, 100).unwrap(); + rank.calculate(522, 100).unwrap(); + + let begin = SystemTime::now(); + let get_time = || SystemTime::now().duration_since(begin).unwrap().as_millis(); + + // Should be fast! + + println!("1"); + rank.add_edge(3, 35, 0.6870330406793382); + assert!(get_time() < 80000); + + println!("2"); + rank.add_edge(3, 27, 0.6750305618933777); + assert!(get_time() < 80000); + + println!("3"); + rank.add_edge(3, 252, 0.6709551330130799); + assert!(get_time() < 80000); + + println!("4"); + rank.add_edge(3, 24, 0.6658611955039131); + assert!(get_time() < 80000); + + println!("5"); + rank.add_edge(3, 286, 0.6332146304754731); + assert!(get_time() < 80000); + + println!("6"); + rank.add_edge(3, 208, 0.6148736192067291); + assert!(get_time() < 80000); + } +} diff --git a/src/constants.rs b/src/constants.rs index f2fb0bf..a2d1405 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,4 +1,4 @@ -pub const ASSERT : bool = std::option_env!("MERITRANK_NO_ASSERT").is_none(); +pub const ASSERT : bool = false; pub const VERBOSE : bool = true; pub const OPTIMIZE_INVALIDATION : bool = true; pub const EPSILON : f64 = 1e-6; diff --git a/src/graph.rs b/src/graph.rs index b0a980f..dd28201 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -1,6 +1,10 @@ -use integer_hasher::IntMap; +use std::collections::HashMap; +use indexmap::IndexMap; +use integer_hasher::{BuildIntHasher, IntMap}; use log::error; +use rand::distributions::{Distribution, WeightedIndex}; +use rand::thread_rng; use crate::errors::MeritRankError; pub type NodeId = usize; @@ -22,16 +26,33 @@ pub struct NodeData{ // The sum of positive edges is often used for normalization, // so it is efficient to cache it. pos_sum: Weight, + pos_distr_cache: Option>, } - impl NodeData { pub fn get_pos_edges_sum(&self) -> Weight { self.pos_sum } + // Return a random neighbor, based on the weight on the edge + pub fn random_neighbor(&mut self) -> Option{ + if let Some(cache) = &self.pos_distr_cache { + let (k, _)= self.pos_edges.iter().nth(cache.sample(&mut thread_rng())).unwrap(); + return Some(*k); + } + let neighbors = self.neighbors(Neighbors::Positive); + if neighbors.is_empty(){ + return None; + } + + let wi = WeightedIndex::new(neighbors.values()).unwrap(); + let (k, _) = self.pos_edges.iter().nth(wi.sample(&mut thread_rng())).unwrap(); + Some(*k) + } + + pub fn neighbors(&self, mode: Neighbors) -> &IntMap { match mode { //Neighbors::All => Some((nbr, weight)), @@ -80,6 +101,7 @@ impl Graph { w if w > 0.0 => { node.pos_edges.insert(to, weight); node.pos_sum += weight; + node.pos_distr_cache = None; }, _ => { node.neg_edges.insert(to, weight); @@ -91,6 +113,9 @@ impl Graph { pub fn get_node_data(&self, node_id: NodeId) -> Option<&NodeData>{ self.nodes.get(node_id) } + pub fn get_node_data_mut(&mut self, node_id: NodeId) -> Option<&mut NodeData>{ + self.nodes.get_mut(node_id) + } /// Removes the edge between the two given nodes from the graph. pub fn remove_edge(&mut self, from: NodeId, to: NodeId)->Result { @@ -100,12 +125,16 @@ impl Graph { let pos_weight = node.pos_edges.remove(&to); let neg_weight = node.neg_edges.remove(&to); - node.pos_sum -= pos_weight.unwrap_or(0.0); - assert!(!(pos_weight.is_some() && neg_weight.is_some())); + + if pos_weight.is_some(){ + node.pos_distr_cache = None; + } + node.pos_sum -= pos_weight.unwrap_or(0.0); Ok(pos_weight.or(neg_weight).expect("Edge not found")) } + pub fn edge_weight(&self, from: NodeId, to: NodeId) -> Result, MeritRankError> { let node = self.nodes.get(from).ok_or(MeritRankError::NodeNotFound)?; if !self.contains_node(to){ diff --git a/src/rank.rs b/src/rank.rs index 597f55c..1ec4974 100644 --- a/src/rank.rs +++ b/src/rank.rs @@ -1,6 +1,7 @@ -use rand::distributions::WeightedIndex; use rand::prelude::*; use integer_hasher::IntMap; + +//Tried to cache the sets in the walks: did not provide any performance improvement. use tinyset::SetUsize; use crate::constants::{EPSILON, ASSERT, OPTIMIZE_INVALIDATION}; use crate::common::sign; @@ -32,17 +33,11 @@ impl MeritRank { pub fn calculate(&mut self, ego: NodeId, num_walks: usize) -> Result<(), MeritRankError> { - let negs = self.graph - .get_node_data(ego) - .ok_or(MeritRankError::NodeDoesNotExist)? - .neighbors(Neighbors::Negative); - self.walks.drop_walks_from_node(ego); self.personal_hits.insert(ego, Counter::new()); for _ in 0..num_walks { let new_walk_id = self.walks.get_next_free_walkid(); - //self.perform_walk(new_walk_id, ego); let new_segment = self.generate_walk_segment(ego, false).unwrap(); let walk = self.walks.get_walk_mut(new_walk_id).unwrap(); @@ -50,13 +45,16 @@ impl MeritRank { walk.push(ego); walk.extend(&new_segment); - - let walk = self.walks.get_walk(new_walk_id).unwrap(); self.personal_hits.entry(ego) .and_modify(|counter| counter.increment_unique_counts(walk.iter().cloned())); + let negs = self.graph + .get_node_data(ego) + .ok_or(MeritRankError::NodeDoesNotExist)? + .neighbors(Neighbors::Negative); + update_negative_hits(&mut self.neg_hits, walk, &negs, false); self.walks.add_walk_to_bookkeeping(new_walk_id, 0); } @@ -95,26 +93,23 @@ impl MeritRank { Ok(peer_scores.clone().into_iter().take(limit.unwrap_or(peer_scores.len())).collect()) } - pub fn generate_walk_segment(&self, start_node: NodeId, mut skip_alpha: bool) -> Result, MeritRankError> { + pub fn generate_walk_segment(&mut self, start_node: NodeId, mut skip_alpha: bool) -> Result, MeritRankError> { let mut node = start_node; let mut segment = Vec::new(); let mut rng = thread_rng(); loop{ - let neighbors = self.graph - .get_node_data(node) - .ok_or(MeritRankError::NodeDoesNotExist)? + let mut node_data =self.graph.get_node_data_mut(node).unwrap(); + let neighbors = node_data .neighbors(Neighbors::Positive); if neighbors.is_empty() { break; } if skip_alpha || rng.gen::() <= self.alpha { skip_alpha = false; - let (peers, weights): (Vec<_>, Vec<_>) = neighbors.iter().unzip(); - let next_step = Self::random_choice(&peers, &weights, &mut rng) - .ok_or(MeritRankError::RandomChoiceError)?; - segment.push(*next_step); - node = *next_step; + let next_step = node_data.random_neighbor().ok_or(MeritRankError::RandomChoiceError)?; + segment.push(next_step); + node = next_step; } else { break; } @@ -123,20 +118,6 @@ impl MeritRank { } - - fn random_choice<'a, T>(values: &'a [T], weights: &[f64], rng: &mut impl Rng) -> Option<&'a T> { - if values.is_empty() || weights.is_empty() || values.len() != weights.len() { - return None; - } - // Idea: optimize by storing the WeightedIndex in the graph for each node? - - match WeightedIndex::new(weights) { - Ok(dist) => values.get(dist.sample(rng)), - Err(_) => None, - } - } - - pub fn update_penalties_for_edge(&mut self, src: NodeId, dest: NodeId, remove_penalties: bool) { let weight = self.graph.edge_weight(src, dest).expect("Node not found!").expect("Edge not found!"); let ego_neg_hits = self.neg_hits.entry(src).or_default(); From dd5dbb40f7376a7940c1e873b5d30ff4a4a4f4ba Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Thu, 18 Jul 2024 19:06:27 +0200 Subject: [PATCH 10/12] Add numwalk to smoke test --- src/constants.rs | 2 +- tests/test_smoke.rs | 1345 ++++++++++++++++++++++--------------------- 2 files changed, 675 insertions(+), 672 deletions(-) diff --git a/src/constants.rs b/src/constants.rs index a2d1405..f2fb0bf 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,4 +1,4 @@ -pub const ASSERT : bool = false; +pub const ASSERT : bool = std::option_env!("MERITRANK_NO_ASSERT").is_none(); pub const VERBOSE : bool = true; pub const OPTIMIZE_INVALIDATION : bool = true; pub const EPSILON : f64 = 1e-6; diff --git a/tests/test_smoke.rs b/tests/test_smoke.rs index 519c1b5..1b34ca8 100644 --- a/tests/test_smoke.rs +++ b/tests/test_smoke.rs @@ -7,6 +7,7 @@ mod tests { fn smoke_perf() { let mut rank = MeritRank::new(Graph::new()).unwrap(); + let numwalks = 200; rank.get_new_nodeid(); rank.get_new_nodeid(); rank.add_edge(0, 1, 1.0); @@ -1400,341 +1401,341 @@ mod tests { rank.add_edge(48, 175, 3.0); rank.add_edge(9, 191, -1.0); rank.add_edge(110, 64, 3.0); - rank.calculate(253, 100).unwrap(); - rank.calculate(299, 100).unwrap(); - rank.calculate(407, 100).unwrap(); - rank.calculate(433, 100).unwrap(); - rank.calculate(312, 100).unwrap(); - rank.calculate(477, 100).unwrap(); - rank.calculate(45, 100).unwrap(); - rank.calculate(508, 100).unwrap(); - rank.calculate(102, 100).unwrap(); - rank.calculate(287, 100).unwrap(); - rank.calculate(124, 100).unwrap(); - rank.calculate(356, 100).unwrap(); - rank.calculate(507, 100).unwrap(); - rank.calculate(523, 100).unwrap(); - rank.calculate(332, 100).unwrap(); - rank.calculate(355, 100).unwrap(); - rank.calculate(367, 100).unwrap(); - rank.calculate(370, 100).unwrap(); - rank.calculate(527, 100).unwrap(); - rank.calculate(245, 100).unwrap(); - rank.calculate(238, 100).unwrap(); - rank.calculate(413, 100).unwrap(); - rank.calculate(108, 100).unwrap(); - rank.calculate(122, 100).unwrap(); - rank.calculate(518, 100).unwrap(); - rank.calculate(443, 100).unwrap(); - rank.calculate(439, 100).unwrap(); - rank.calculate(429, 100).unwrap(); - rank.calculate(321, 100).unwrap(); - rank.calculate(97, 100).unwrap(); - rank.calculate(162, 100).unwrap(); - rank.calculate(488, 100).unwrap(); - rank.calculate(44, 100).unwrap(); - rank.calculate(465, 100).unwrap(); - rank.calculate(368, 100).unwrap(); - rank.calculate(446, 100).unwrap(); - rank.calculate(365, 100).unwrap(); - rank.calculate(239, 100).unwrap(); - rank.calculate(371, 100).unwrap(); - rank.calculate(485, 100).unwrap(); - rank.calculate(334, 100).unwrap(); - rank.calculate(199, 100).unwrap(); - rank.calculate(525, 100).unwrap(); - rank.calculate(179, 100).unwrap(); - rank.calculate(18, 100).unwrap(); - rank.calculate(404, 100).unwrap(); - rank.calculate(6, 100).unwrap(); - rank.calculate(0, 100).unwrap(); - rank.calculate(416, 100).unwrap(); - rank.calculate(495, 100).unwrap(); - rank.calculate(160, 100).unwrap(); - rank.calculate(351, 100).unwrap(); - rank.calculate(169, 100).unwrap(); - rank.calculate(214, 100).unwrap(); - rank.calculate(295, 100).unwrap(); - rank.calculate(291, 100).unwrap(); - rank.calculate(30, 100).unwrap(); - rank.calculate(55, 100).unwrap(); - rank.calculate(530, 100).unwrap(); - rank.calculate(164, 100).unwrap(); - rank.calculate(535, 100).unwrap(); - rank.calculate(94, 100).unwrap(); - rank.calculate(516, 100).unwrap(); - rank.calculate(419, 100).unwrap(); - rank.calculate(366, 100).unwrap(); - rank.calculate(235, 100).unwrap(); - rank.calculate(273, 100).unwrap(); - rank.calculate(188, 100).unwrap(); - rank.calculate(192, 100).unwrap(); - rank.calculate(167, 100).unwrap(); - rank.calculate(360, 100).unwrap(); - rank.calculate(412, 100).unwrap(); - rank.calculate(381, 100).unwrap(); - rank.calculate(352, 100).unwrap(); - rank.calculate(482, 100).unwrap(); - rank.calculate(318, 100).unwrap(); - rank.calculate(210, 100).unwrap(); - rank.calculate(424, 100).unwrap(); - rank.calculate(379, 100).unwrap(); - rank.calculate(358, 100).unwrap(); - rank.calculate(4, 100).unwrap(); - rank.calculate(101, 100).unwrap(); - rank.calculate(31, 100).unwrap(); - rank.calculate(496, 100).unwrap(); - rank.calculate(457, 100).unwrap(); - rank.calculate(16, 100).unwrap(); - rank.calculate(313, 100).unwrap(); - rank.calculate(382, 100).unwrap(); - rank.calculate(490, 100).unwrap(); - rank.calculate(435, 100).unwrap(); - rank.calculate(484, 100).unwrap(); - rank.calculate(375, 100).unwrap(); - rank.calculate(166, 100).unwrap(); - rank.calculate(144, 100).unwrap(); - rank.calculate(78, 100).unwrap(); - rank.calculate(289, 100).unwrap(); - rank.calculate(533, 100).unwrap(); - rank.calculate(190, 100).unwrap(); - rank.calculate(136, 100).unwrap(); - rank.calculate(276, 100).unwrap(); - rank.calculate(293, 100).unwrap(); - rank.calculate(519, 100).unwrap(); - rank.calculate(43, 100).unwrap(); - rank.calculate(201, 100).unwrap(); - rank.calculate(406, 100).unwrap(); - rank.calculate(521, 100).unwrap(); - rank.calculate(13, 100).unwrap(); - rank.calculate(515, 100).unwrap(); - rank.calculate(491, 100).unwrap(); - rank.calculate(74, 100).unwrap(); - rank.calculate(41, 100).unwrap(); - rank.calculate(335, 100).unwrap(); - rank.calculate(230, 100).unwrap(); - rank.calculate(56, 100).unwrap(); - rank.calculate(8, 100).unwrap(); - rank.calculate(265, 100).unwrap(); - rank.calculate(336, 100).unwrap(); - rank.calculate(42, 100).unwrap(); - rank.calculate(93, 100).unwrap(); - rank.calculate(300, 100).unwrap(); - rank.calculate(178, 100).unwrap(); - rank.calculate(84, 100).unwrap(); - rank.calculate(35, 100).unwrap(); - rank.calculate(40, 100).unwrap(); - rank.calculate(143, 100).unwrap(); - rank.calculate(514, 100).unwrap(); - rank.calculate(127, 100).unwrap(); - rank.calculate(130, 100).unwrap(); - rank.calculate(466, 100).unwrap(); - rank.calculate(493, 100).unwrap(); - rank.calculate(183, 100).unwrap(); - rank.calculate(50, 100).unwrap(); - rank.calculate(58, 100).unwrap(); - rank.calculate(263, 100).unwrap(); - rank.calculate(476, 100).unwrap(); - rank.calculate(79, 100).unwrap(); - rank.calculate(217, 100).unwrap(); - rank.calculate(177, 100).unwrap(); - rank.calculate(315, 100).unwrap(); - rank.calculate(248, 100).unwrap(); - rank.calculate(502, 100).unwrap(); - rank.calculate(267, 100).unwrap(); - rank.calculate(510, 100).unwrap(); - rank.calculate(228, 100).unwrap(); - rank.calculate(442, 100).unwrap(); - rank.calculate(65, 100).unwrap(); - rank.calculate(70, 100).unwrap(); - rank.calculate(203, 100).unwrap(); - rank.calculate(319, 100).unwrap(); - rank.calculate(62, 100).unwrap(); - rank.calculate(378, 100).unwrap(); - rank.calculate(423, 100).unwrap(); - rank.calculate(444, 100).unwrap(); - rank.calculate(471, 100).unwrap(); - rank.calculate(480, 100).unwrap(); - rank.calculate(151, 100).unwrap(); - rank.calculate(282, 100).unwrap(); - rank.calculate(489, 100).unwrap(); - rank.calculate(21, 100).unwrap(); - rank.calculate(141, 100).unwrap(); - rank.calculate(114, 100).unwrap(); - rank.calculate(59, 100).unwrap(); - rank.calculate(306, 100).unwrap(); - rank.calculate(325, 100).unwrap(); - rank.calculate(219, 100).unwrap(); - rank.calculate(280, 100).unwrap(); - rank.calculate(57, 100).unwrap(); - rank.calculate(221, 100).unwrap(); - rank.calculate(506, 100).unwrap(); - rank.calculate(410, 100).unwrap(); - rank.calculate(67, 100).unwrap(); - rank.calculate(91, 100).unwrap(); - rank.calculate(113, 100).unwrap(); - rank.calculate(425, 100).unwrap(); - rank.calculate(198, 100).unwrap(); - rank.calculate(272, 100).unwrap(); - rank.calculate(353, 100).unwrap(); - rank.calculate(451, 100).unwrap(); - rank.calculate(494, 100).unwrap(); - rank.calculate(456, 100).unwrap(); - rank.calculate(513, 100).unwrap(); - rank.calculate(53, 100).unwrap(); - rank.calculate(526, 100).unwrap(); - rank.calculate(420, 100).unwrap(); - rank.calculate(80, 100).unwrap(); - rank.calculate(2, 100).unwrap(); - rank.calculate(498, 100).unwrap(); - rank.calculate(499, 100).unwrap(); - rank.calculate(509, 100).unwrap(); - rank.calculate(186, 100).unwrap(); - rank.calculate(234, 100).unwrap(); - rank.calculate(430, 100).unwrap(); - rank.calculate(224, 100).unwrap(); - rank.calculate(222, 100).unwrap(); - rank.calculate(28, 100).unwrap(); - rank.calculate(415, 100).unwrap(); - rank.calculate(447, 100).unwrap(); - rank.calculate(257, 100).unwrap(); - rank.calculate(427, 100).unwrap(); - rank.calculate(487, 100).unwrap(); - rank.calculate(180, 100).unwrap(); - rank.calculate(133, 100).unwrap(); - rank.calculate(417, 100).unwrap(); - rank.calculate(532, 100).unwrap(); - rank.calculate(524, 100).unwrap(); - rank.calculate(483, 100).unwrap(); - rank.calculate(297, 100).unwrap(); - rank.calculate(68, 100).unwrap(); - rank.calculate(226, 100).unwrap(); - rank.calculate(463, 100).unwrap(); - rank.calculate(99, 100).unwrap(); - rank.calculate(403, 100).unwrap(); - rank.calculate(441, 100).unwrap(); - rank.calculate(77, 100).unwrap(); - rank.calculate(85, 100).unwrap(); - rank.calculate(348, 100).unwrap(); - rank.calculate(504, 100).unwrap(); - rank.calculate(12, 100).unwrap(); - rank.calculate(388, 100).unwrap(); - rank.calculate(342, 100).unwrap(); - rank.calculate(362, 100).unwrap(); - rank.calculate(534, 100).unwrap(); - rank.calculate(333, 100).unwrap(); - rank.calculate(200, 100).unwrap(); - rank.calculate(384, 100).unwrap(); - rank.calculate(33, 100).unwrap(); - rank.calculate(440, 100).unwrap(); - rank.calculate(475, 100).unwrap(); - rank.calculate(460, 100).unwrap(); - rank.calculate(517, 100).unwrap(); - rank.calculate(255, 100).unwrap(); - rank.calculate(537, 100).unwrap(); - rank.calculate(275, 100).unwrap(); - rank.calculate(145, 100).unwrap(); - rank.calculate(87, 100).unwrap(); - rank.calculate(434, 100).unwrap(); - rank.calculate(39, 100).unwrap(); - rank.calculate(262, 100).unwrap(); - rank.calculate(285, 100).unwrap(); - rank.calculate(469, 100).unwrap(); - rank.calculate(390, 100).unwrap(); - rank.calculate(343, 100).unwrap(); - rank.calculate(36, 100).unwrap(); - rank.calculate(52, 100).unwrap(); - rank.calculate(90, 100).unwrap(); - rank.calculate(15, 100).unwrap(); - rank.calculate(421, 100).unwrap(); - rank.calculate(196, 100).unwrap(); - rank.calculate(163, 100).unwrap(); - rank.calculate(400, 100).unwrap(); - rank.calculate(505, 100).unwrap(); - rank.calculate(422, 100).unwrap(); - rank.calculate(330, 100).unwrap(); - rank.calculate(464, 100).unwrap(); - rank.calculate(11, 100).unwrap(); - rank.calculate(47, 100).unwrap(); - rank.calculate(314, 100).unwrap(); - rank.calculate(76, 100).unwrap(); - rank.calculate(344, 100).unwrap(); - rank.calculate(520, 100).unwrap(); - rank.calculate(459, 100).unwrap(); - rank.calculate(218, 100).unwrap(); - rank.calculate(536, 100).unwrap(); - rank.calculate(492, 100).unwrap(); - rank.calculate(149, 100).unwrap(); - rank.calculate(120, 100).unwrap(); - rank.calculate(323, 100).unwrap(); - rank.calculate(346, 100).unwrap(); - rank.calculate(104, 100).unwrap(); - rank.calculate(19, 100).unwrap(); - rank.calculate(63, 100).unwrap(); - rank.calculate(107, 100).unwrap(); - rank.calculate(481, 100).unwrap(); - rank.calculate(138, 100).unwrap(); - rank.calculate(23, 100).unwrap(); - rank.calculate(153, 100).unwrap(); - rank.calculate(207, 100).unwrap(); - rank.calculate(411, 100).unwrap(); - rank.calculate(193, 100).unwrap(); - rank.calculate(232, 100).unwrap(); - rank.calculate(327, 100).unwrap(); - rank.calculate(512, 100).unwrap(); - rank.calculate(159, 100).unwrap(); - rank.calculate(105, 100).unwrap(); - rank.calculate(48, 100).unwrap(); - rank.calculate(270, 100).unwrap(); - rank.calculate(9, 100).unwrap(); - rank.calculate(393, 100).unwrap(); - rank.calculate(529, 100).unwrap(); - rank.calculate(350, 100).unwrap(); - rank.calculate(472, 100).unwrap(); - rank.calculate(181, 100).unwrap(); - rank.calculate(380, 100).unwrap(); - rank.calculate(414, 100).unwrap(); - rank.calculate(197, 100).unwrap(); - rank.calculate(189, 100).unwrap(); - rank.calculate(431, 100).unwrap(); - rank.calculate(110, 100).unwrap(); - rank.calculate(284, 100).unwrap(); - rank.calculate(426, 100).unwrap(); - rank.calculate(142, 100).unwrap(); - rank.calculate(259, 100).unwrap(); - rank.calculate(303, 100).unwrap(); - rank.calculate(402, 100).unwrap(); - rank.calculate(211, 100).unwrap(); - rank.calculate(283, 100).unwrap(); - rank.calculate(288, 100).unwrap(); - rank.calculate(392, 100).unwrap(); - rank.calculate(281, 100).unwrap(); - rank.calculate(478, 100).unwrap(); - rank.calculate(215, 100).unwrap(); - rank.calculate(385, 100).unwrap(); - rank.calculate(528, 100).unwrap(); - rank.calculate(82, 100).unwrap(); - rank.calculate(474, 100).unwrap(); - rank.calculate(117, 100).unwrap(); - rank.calculate(418, 100).unwrap(); - rank.calculate(448, 100).unwrap(); - rank.calculate(150, 100).unwrap(); - rank.calculate(132, 100).unwrap(); - rank.calculate(397, 100).unwrap(); - rank.calculate(467, 100).unwrap(); - rank.calculate(473, 100).unwrap(); - rank.calculate(479, 100).unwrap(); - rank.calculate(27, 100).unwrap(); - rank.calculate(29, 100).unwrap(); - rank.calculate(386, 100).unwrap(); - rank.calculate(195, 100).unwrap(); - rank.calculate(497, 100).unwrap(); - rank.calculate(500, 100).unwrap(); - rank.calculate(69, 100).unwrap(); - rank.calculate(531, 100).unwrap(); - rank.calculate(454, 100).unwrap(); - rank.calculate(349, 100).unwrap(); - rank.calculate(522, 100).unwrap(); + rank.calculate(253, numwalks).unwrap(); + rank.calculate(299, numwalks).unwrap(); + rank.calculate(407, numwalks).unwrap(); + rank.calculate(433, numwalks).unwrap(); + rank.calculate(312, numwalks).unwrap(); + rank.calculate(477, numwalks).unwrap(); + rank.calculate(45, numwalks).unwrap(); + rank.calculate(508, numwalks).unwrap(); + rank.calculate(102, numwalks).unwrap(); + rank.calculate(287, numwalks).unwrap(); + rank.calculate(124, numwalks).unwrap(); + rank.calculate(356, numwalks).unwrap(); + rank.calculate(507, numwalks).unwrap(); + rank.calculate(523, numwalks).unwrap(); + rank.calculate(332, numwalks).unwrap(); + rank.calculate(355, numwalks).unwrap(); + rank.calculate(367, numwalks).unwrap(); + rank.calculate(370, numwalks).unwrap(); + rank.calculate(527, numwalks).unwrap(); + rank.calculate(245, numwalks).unwrap(); + rank.calculate(238, numwalks).unwrap(); + rank.calculate(413, numwalks).unwrap(); + rank.calculate(108, numwalks).unwrap(); + rank.calculate(122, numwalks).unwrap(); + rank.calculate(518, numwalks).unwrap(); + rank.calculate(443, numwalks).unwrap(); + rank.calculate(439, numwalks).unwrap(); + rank.calculate(429, numwalks).unwrap(); + rank.calculate(321, numwalks).unwrap(); + rank.calculate(97, numwalks).unwrap(); + rank.calculate(162, numwalks).unwrap(); + rank.calculate(488, numwalks).unwrap(); + rank.calculate(44, numwalks).unwrap(); + rank.calculate(465, numwalks).unwrap(); + rank.calculate(368, numwalks).unwrap(); + rank.calculate(446, numwalks).unwrap(); + rank.calculate(365, numwalks).unwrap(); + rank.calculate(239, numwalks).unwrap(); + rank.calculate(371, numwalks).unwrap(); + rank.calculate(485, numwalks).unwrap(); + rank.calculate(334, numwalks).unwrap(); + rank.calculate(199, numwalks).unwrap(); + rank.calculate(525, numwalks).unwrap(); + rank.calculate(179, numwalks).unwrap(); + rank.calculate(18, numwalks).unwrap(); + rank.calculate(404, numwalks).unwrap(); + rank.calculate(6, numwalks).unwrap(); + rank.calculate(0, numwalks).unwrap(); + rank.calculate(416, numwalks).unwrap(); + rank.calculate(495, numwalks).unwrap(); + rank.calculate(160, numwalks).unwrap(); + rank.calculate(351, numwalks).unwrap(); + rank.calculate(169, numwalks).unwrap(); + rank.calculate(214, numwalks).unwrap(); + rank.calculate(295, numwalks).unwrap(); + rank.calculate(291, numwalks).unwrap(); + rank.calculate(30, numwalks).unwrap(); + rank.calculate(55, numwalks).unwrap(); + rank.calculate(530, numwalks).unwrap(); + rank.calculate(164, numwalks).unwrap(); + rank.calculate(535, numwalks).unwrap(); + rank.calculate(94, numwalks).unwrap(); + rank.calculate(516, numwalks).unwrap(); + rank.calculate(419, numwalks).unwrap(); + rank.calculate(366, numwalks).unwrap(); + rank.calculate(235, numwalks).unwrap(); + rank.calculate(273, numwalks).unwrap(); + rank.calculate(188, numwalks).unwrap(); + rank.calculate(192, numwalks).unwrap(); + rank.calculate(167, numwalks).unwrap(); + rank.calculate(360, numwalks).unwrap(); + rank.calculate(412, numwalks).unwrap(); + rank.calculate(381, numwalks).unwrap(); + rank.calculate(352, numwalks).unwrap(); + rank.calculate(482, numwalks).unwrap(); + rank.calculate(318, numwalks).unwrap(); + rank.calculate(210, numwalks).unwrap(); + rank.calculate(424, numwalks).unwrap(); + rank.calculate(379, numwalks).unwrap(); + rank.calculate(358, numwalks).unwrap(); + rank.calculate(4, numwalks).unwrap(); + rank.calculate(101, numwalks).unwrap(); + rank.calculate(31, numwalks).unwrap(); + rank.calculate(496, numwalks).unwrap(); + rank.calculate(457, numwalks).unwrap(); + rank.calculate(16, numwalks).unwrap(); + rank.calculate(313, numwalks).unwrap(); + rank.calculate(382, numwalks).unwrap(); + rank.calculate(490, numwalks).unwrap(); + rank.calculate(435, numwalks).unwrap(); + rank.calculate(484, numwalks).unwrap(); + rank.calculate(375, numwalks).unwrap(); + rank.calculate(166, numwalks).unwrap(); + rank.calculate(144, numwalks).unwrap(); + rank.calculate(78, numwalks).unwrap(); + rank.calculate(289, numwalks).unwrap(); + rank.calculate(533, numwalks).unwrap(); + rank.calculate(190, numwalks).unwrap(); + rank.calculate(136, numwalks).unwrap(); + rank.calculate(276, numwalks).unwrap(); + rank.calculate(293, numwalks).unwrap(); + rank.calculate(519, numwalks).unwrap(); + rank.calculate(43, numwalks).unwrap(); + rank.calculate(201, numwalks).unwrap(); + rank.calculate(406, numwalks).unwrap(); + rank.calculate(521, numwalks).unwrap(); + rank.calculate(13, numwalks).unwrap(); + rank.calculate(515, numwalks).unwrap(); + rank.calculate(491, numwalks).unwrap(); + rank.calculate(74, numwalks).unwrap(); + rank.calculate(41, numwalks).unwrap(); + rank.calculate(335, numwalks).unwrap(); + rank.calculate(230, numwalks).unwrap(); + rank.calculate(56, numwalks).unwrap(); + rank.calculate(8, numwalks).unwrap(); + rank.calculate(265, numwalks).unwrap(); + rank.calculate(336, numwalks).unwrap(); + rank.calculate(42, numwalks).unwrap(); + rank.calculate(93, numwalks).unwrap(); + rank.calculate(300, numwalks).unwrap(); + rank.calculate(178, numwalks).unwrap(); + rank.calculate(84, numwalks).unwrap(); + rank.calculate(35, numwalks).unwrap(); + rank.calculate(40, numwalks).unwrap(); + rank.calculate(143, numwalks).unwrap(); + rank.calculate(514, numwalks).unwrap(); + rank.calculate(127, numwalks).unwrap(); + rank.calculate(130, numwalks).unwrap(); + rank.calculate(466, numwalks).unwrap(); + rank.calculate(493, numwalks).unwrap(); + rank.calculate(183, numwalks).unwrap(); + rank.calculate(50, numwalks).unwrap(); + rank.calculate(58, numwalks).unwrap(); + rank.calculate(263, numwalks).unwrap(); + rank.calculate(476, numwalks).unwrap(); + rank.calculate(79, numwalks).unwrap(); + rank.calculate(217, numwalks).unwrap(); + rank.calculate(177, numwalks).unwrap(); + rank.calculate(315, numwalks).unwrap(); + rank.calculate(248, numwalks).unwrap(); + rank.calculate(502, numwalks).unwrap(); + rank.calculate(267, numwalks).unwrap(); + rank.calculate(510, numwalks).unwrap(); + rank.calculate(228, numwalks).unwrap(); + rank.calculate(442, numwalks).unwrap(); + rank.calculate(65, numwalks).unwrap(); + rank.calculate(70, numwalks).unwrap(); + rank.calculate(203, numwalks).unwrap(); + rank.calculate(319, numwalks).unwrap(); + rank.calculate(62, numwalks).unwrap(); + rank.calculate(378, numwalks).unwrap(); + rank.calculate(423, numwalks).unwrap(); + rank.calculate(444, numwalks).unwrap(); + rank.calculate(471, numwalks).unwrap(); + rank.calculate(480, numwalks).unwrap(); + rank.calculate(151, numwalks).unwrap(); + rank.calculate(282, numwalks).unwrap(); + rank.calculate(489, numwalks).unwrap(); + rank.calculate(21, numwalks).unwrap(); + rank.calculate(141, numwalks).unwrap(); + rank.calculate(114, numwalks).unwrap(); + rank.calculate(59, numwalks).unwrap(); + rank.calculate(306, numwalks).unwrap(); + rank.calculate(325, numwalks).unwrap(); + rank.calculate(219, numwalks).unwrap(); + rank.calculate(280, numwalks).unwrap(); + rank.calculate(57, numwalks).unwrap(); + rank.calculate(221, numwalks).unwrap(); + rank.calculate(506, numwalks).unwrap(); + rank.calculate(410, numwalks).unwrap(); + rank.calculate(67, numwalks).unwrap(); + rank.calculate(91, numwalks).unwrap(); + rank.calculate(113, numwalks).unwrap(); + rank.calculate(425, numwalks).unwrap(); + rank.calculate(198, numwalks).unwrap(); + rank.calculate(272, numwalks).unwrap(); + rank.calculate(353, numwalks).unwrap(); + rank.calculate(451, numwalks).unwrap(); + rank.calculate(494, numwalks).unwrap(); + rank.calculate(456, numwalks).unwrap(); + rank.calculate(513, numwalks).unwrap(); + rank.calculate(53, numwalks).unwrap(); + rank.calculate(526, numwalks).unwrap(); + rank.calculate(420, numwalks).unwrap(); + rank.calculate(80, numwalks).unwrap(); + rank.calculate(2, numwalks).unwrap(); + rank.calculate(498, numwalks).unwrap(); + rank.calculate(499, numwalks).unwrap(); + rank.calculate(509, numwalks).unwrap(); + rank.calculate(186, numwalks).unwrap(); + rank.calculate(234, numwalks).unwrap(); + rank.calculate(430, numwalks).unwrap(); + rank.calculate(224, numwalks).unwrap(); + rank.calculate(222, numwalks).unwrap(); + rank.calculate(28, numwalks).unwrap(); + rank.calculate(415, numwalks).unwrap(); + rank.calculate(447, numwalks).unwrap(); + rank.calculate(257, numwalks).unwrap(); + rank.calculate(427, numwalks).unwrap(); + rank.calculate(487, numwalks).unwrap(); + rank.calculate(180, numwalks).unwrap(); + rank.calculate(133, numwalks).unwrap(); + rank.calculate(417, numwalks).unwrap(); + rank.calculate(532, numwalks).unwrap(); + rank.calculate(524, numwalks).unwrap(); + rank.calculate(483, numwalks).unwrap(); + rank.calculate(297, numwalks).unwrap(); + rank.calculate(68, numwalks).unwrap(); + rank.calculate(226, numwalks).unwrap(); + rank.calculate(463, numwalks).unwrap(); + rank.calculate(99, numwalks).unwrap(); + rank.calculate(403, numwalks).unwrap(); + rank.calculate(441, numwalks).unwrap(); + rank.calculate(77, numwalks).unwrap(); + rank.calculate(85, numwalks).unwrap(); + rank.calculate(348, numwalks).unwrap(); + rank.calculate(504, numwalks).unwrap(); + rank.calculate(12, numwalks).unwrap(); + rank.calculate(388, numwalks).unwrap(); + rank.calculate(342, numwalks).unwrap(); + rank.calculate(362, numwalks).unwrap(); + rank.calculate(534, numwalks).unwrap(); + rank.calculate(333, numwalks).unwrap(); + rank.calculate(200, numwalks).unwrap(); + rank.calculate(384, numwalks).unwrap(); + rank.calculate(33, numwalks).unwrap(); + rank.calculate(440, numwalks).unwrap(); + rank.calculate(475, numwalks).unwrap(); + rank.calculate(460, numwalks).unwrap(); + rank.calculate(517, numwalks).unwrap(); + rank.calculate(255, numwalks).unwrap(); + rank.calculate(537, numwalks).unwrap(); + rank.calculate(275, numwalks).unwrap(); + rank.calculate(145, numwalks).unwrap(); + rank.calculate(87, numwalks).unwrap(); + rank.calculate(434, numwalks).unwrap(); + rank.calculate(39, numwalks).unwrap(); + rank.calculate(262, numwalks).unwrap(); + rank.calculate(285, numwalks).unwrap(); + rank.calculate(469, numwalks).unwrap(); + rank.calculate(390, numwalks).unwrap(); + rank.calculate(343, numwalks).unwrap(); + rank.calculate(36, numwalks).unwrap(); + rank.calculate(52, numwalks).unwrap(); + rank.calculate(90, numwalks).unwrap(); + rank.calculate(15, numwalks).unwrap(); + rank.calculate(421, numwalks).unwrap(); + rank.calculate(196, numwalks).unwrap(); + rank.calculate(163, numwalks).unwrap(); + rank.calculate(400, numwalks).unwrap(); + rank.calculate(505, numwalks).unwrap(); + rank.calculate(422, numwalks).unwrap(); + rank.calculate(330, numwalks).unwrap(); + rank.calculate(464, numwalks).unwrap(); + rank.calculate(11, numwalks).unwrap(); + rank.calculate(47, numwalks).unwrap(); + rank.calculate(314, numwalks).unwrap(); + rank.calculate(76, numwalks).unwrap(); + rank.calculate(344, numwalks).unwrap(); + rank.calculate(520, numwalks).unwrap(); + rank.calculate(459, numwalks).unwrap(); + rank.calculate(218, numwalks).unwrap(); + rank.calculate(536, numwalks).unwrap(); + rank.calculate(492, numwalks).unwrap(); + rank.calculate(149, numwalks).unwrap(); + rank.calculate(120, numwalks).unwrap(); + rank.calculate(323, numwalks).unwrap(); + rank.calculate(346, numwalks).unwrap(); + rank.calculate(104, numwalks).unwrap(); + rank.calculate(19, numwalks).unwrap(); + rank.calculate(63, numwalks).unwrap(); + rank.calculate(107, numwalks).unwrap(); + rank.calculate(481, numwalks).unwrap(); + rank.calculate(138, numwalks).unwrap(); + rank.calculate(23, numwalks).unwrap(); + rank.calculate(153, numwalks).unwrap(); + rank.calculate(207, numwalks).unwrap(); + rank.calculate(411, numwalks).unwrap(); + rank.calculate(193, numwalks).unwrap(); + rank.calculate(232, numwalks).unwrap(); + rank.calculate(327, numwalks).unwrap(); + rank.calculate(512, numwalks).unwrap(); + rank.calculate(159, numwalks).unwrap(); + rank.calculate(105, numwalks).unwrap(); + rank.calculate(48, numwalks).unwrap(); + rank.calculate(270, numwalks).unwrap(); + rank.calculate(9, numwalks).unwrap(); + rank.calculate(393, numwalks).unwrap(); + rank.calculate(529, numwalks).unwrap(); + rank.calculate(350, numwalks).unwrap(); + rank.calculate(472, numwalks).unwrap(); + rank.calculate(181, numwalks).unwrap(); + rank.calculate(380, numwalks).unwrap(); + rank.calculate(414, numwalks).unwrap(); + rank.calculate(197, numwalks).unwrap(); + rank.calculate(189, numwalks).unwrap(); + rank.calculate(431, numwalks).unwrap(); + rank.calculate(110, numwalks).unwrap(); + rank.calculate(284, numwalks).unwrap(); + rank.calculate(426, numwalks).unwrap(); + rank.calculate(142, numwalks).unwrap(); + rank.calculate(259, numwalks).unwrap(); + rank.calculate(303, numwalks).unwrap(); + rank.calculate(402, numwalks).unwrap(); + rank.calculate(211, numwalks).unwrap(); + rank.calculate(283, numwalks).unwrap(); + rank.calculate(288, numwalks).unwrap(); + rank.calculate(392, numwalks).unwrap(); + rank.calculate(281, numwalks).unwrap(); + rank.calculate(478, numwalks).unwrap(); + rank.calculate(215, numwalks).unwrap(); + rank.calculate(385, numwalks).unwrap(); + rank.calculate(528, numwalks).unwrap(); + rank.calculate(82, numwalks).unwrap(); + rank.calculate(474, numwalks).unwrap(); + rank.calculate(117, numwalks).unwrap(); + rank.calculate(418, numwalks).unwrap(); + rank.calculate(448, numwalks).unwrap(); + rank.calculate(150, numwalks).unwrap(); + rank.calculate(132, numwalks).unwrap(); + rank.calculate(397, numwalks).unwrap(); + rank.calculate(467, numwalks).unwrap(); + rank.calculate(473, numwalks).unwrap(); + rank.calculate(479, numwalks).unwrap(); + rank.calculate(27, numwalks).unwrap(); + rank.calculate(29, numwalks).unwrap(); + rank.calculate(386, numwalks).unwrap(); + rank.calculate(195, numwalks).unwrap(); + rank.calculate(497, numwalks).unwrap(); + rank.calculate(500, numwalks).unwrap(); + rank.calculate(69, numwalks).unwrap(); + rank.calculate(531, numwalks).unwrap(); + rank.calculate(454, numwalks).unwrap(); + rank.calculate(349, numwalks).unwrap(); + rank.calculate(522, numwalks).unwrap(); let begin = SystemTime::now(); let get_time = || SystemTime::now().duration_since(begin).unwrap().as_millis(); @@ -1770,6 +1771,8 @@ mod tests { fn smoke_perf_with_zero() { let mut rank = MeritRank::new(Graph::new()).unwrap(); + let numwalks = 100; + rank.get_new_nodeid(); rank.get_new_nodeid(); rank.add_edge(0, 1, 1.0); @@ -3498,342 +3501,342 @@ mod tests { rank.add_edge(48, 175, 3.0); rank.add_edge(9, 191, -1.0); rank.add_edge(110, 64, 3.0); - rank.calculate(253, 100).unwrap(); - rank.calculate(299, 100).unwrap(); - rank.calculate(407, 100).unwrap(); - rank.calculate(433, 100).unwrap(); - rank.calculate(312, 100).unwrap(); - rank.calculate(477, 100).unwrap(); - rank.calculate(45, 100).unwrap(); - rank.calculate(508, 100).unwrap(); - rank.calculate(102, 100).unwrap(); - rank.calculate(287, 100).unwrap(); - rank.calculate(124, 100).unwrap(); - rank.calculate(356, 100).unwrap(); - rank.calculate(507, 100).unwrap(); - rank.calculate(523, 100).unwrap(); - rank.calculate(332, 100).unwrap(); - rank.calculate(355, 100).unwrap(); - rank.calculate(367, 100).unwrap(); - rank.calculate(370, 100).unwrap(); - rank.calculate(527, 100).unwrap(); - rank.calculate(245, 100).unwrap(); - rank.calculate(238, 100).unwrap(); - rank.calculate(413, 100).unwrap(); - rank.calculate(108, 100).unwrap(); - rank.calculate(122, 100).unwrap(); - rank.calculate(518, 100).unwrap(); - rank.calculate(443, 100).unwrap(); - rank.calculate(439, 100).unwrap(); - rank.calculate(429, 100).unwrap(); - rank.calculate(321, 100).unwrap(); - rank.calculate(97, 100).unwrap(); - rank.calculate(162, 100).unwrap(); - rank.calculate(488, 100).unwrap(); - rank.calculate(44, 100).unwrap(); - rank.calculate(465, 100).unwrap(); - rank.calculate(368, 100).unwrap(); - rank.calculate(446, 100).unwrap(); - rank.calculate(365, 100).unwrap(); - rank.calculate(239, 100).unwrap(); - rank.calculate(371, 100).unwrap(); - rank.calculate(485, 100).unwrap(); - rank.calculate(334, 100).unwrap(); - rank.calculate(199, 100).unwrap(); - rank.calculate(525, 100).unwrap(); - rank.calculate(179, 100).unwrap(); - rank.calculate(18, 100).unwrap(); - rank.calculate(404, 100).unwrap(); - rank.calculate(6, 100).unwrap(); - rank.calculate(0, 100).unwrap(); - rank.calculate(416, 100).unwrap(); - rank.calculate(495, 100).unwrap(); - rank.calculate(160, 100).unwrap(); - rank.calculate(351, 100).unwrap(); - rank.calculate(169, 100).unwrap(); - rank.calculate(214, 100).unwrap(); - rank.calculate(295, 100).unwrap(); - rank.calculate(291, 100).unwrap(); - rank.calculate(30, 100).unwrap(); - rank.calculate(55, 100).unwrap(); - rank.calculate(530, 100).unwrap(); - rank.calculate(164, 100).unwrap(); - rank.calculate(535, 100).unwrap(); - rank.calculate(94, 100).unwrap(); - rank.calculate(516, 100).unwrap(); - rank.calculate(419, 100).unwrap(); - rank.calculate(366, 100).unwrap(); - rank.calculate(235, 100).unwrap(); - rank.calculate(273, 100).unwrap(); - rank.calculate(188, 100).unwrap(); - rank.calculate(192, 100).unwrap(); - rank.calculate(167, 100).unwrap(); - rank.calculate(360, 100).unwrap(); - rank.calculate(412, 100).unwrap(); - rank.calculate(381, 100).unwrap(); - rank.calculate(352, 100).unwrap(); - rank.calculate(482, 100).unwrap(); - rank.calculate(318, 100).unwrap(); - rank.calculate(210, 100).unwrap(); - rank.calculate(424, 100).unwrap(); - rank.calculate(379, 100).unwrap(); - rank.calculate(358, 100).unwrap(); - rank.calculate(4, 100).unwrap(); - rank.calculate(101, 100).unwrap(); - rank.calculate(31, 100).unwrap(); - rank.calculate(496, 100).unwrap(); - rank.calculate(457, 100).unwrap(); - rank.calculate(16, 100).unwrap(); - rank.calculate(313, 100).unwrap(); - rank.calculate(382, 100).unwrap(); - rank.calculate(490, 100).unwrap(); - rank.calculate(435, 100).unwrap(); - rank.calculate(484, 100).unwrap(); - rank.calculate(375, 100).unwrap(); - rank.calculate(166, 100).unwrap(); - rank.calculate(144, 100).unwrap(); - rank.calculate(78, 100).unwrap(); - rank.calculate(289, 100).unwrap(); - rank.calculate(533, 100).unwrap(); - rank.calculate(190, 100).unwrap(); - rank.calculate(136, 100).unwrap(); - rank.calculate(276, 100).unwrap(); - rank.calculate(293, 100).unwrap(); - rank.calculate(519, 100).unwrap(); - rank.calculate(43, 100).unwrap(); - rank.calculate(201, 100).unwrap(); - rank.calculate(406, 100).unwrap(); - rank.calculate(521, 100).unwrap(); - rank.calculate(13, 100).unwrap(); - rank.calculate(515, 100).unwrap(); - rank.calculate(491, 100).unwrap(); - rank.calculate(74, 100).unwrap(); - rank.calculate(41, 100).unwrap(); - rank.calculate(335, 100).unwrap(); - rank.calculate(230, 100).unwrap(); - rank.calculate(56, 100).unwrap(); - rank.calculate(8, 100).unwrap(); - rank.calculate(265, 100).unwrap(); - rank.calculate(336, 100).unwrap(); - rank.calculate(42, 100).unwrap(); - rank.calculate(93, 100).unwrap(); - rank.calculate(300, 100).unwrap(); - rank.calculate(178, 100).unwrap(); - rank.calculate(84, 100).unwrap(); - rank.calculate(35, 100).unwrap(); - rank.calculate(40, 100).unwrap(); - rank.calculate(143, 100).unwrap(); - rank.calculate(514, 100).unwrap(); - rank.calculate(127, 100).unwrap(); - rank.calculate(130, 100).unwrap(); - rank.calculate(466, 100).unwrap(); - rank.calculate(493, 100).unwrap(); - rank.calculate(183, 100).unwrap(); - rank.calculate(50, 100).unwrap(); - rank.calculate(58, 100).unwrap(); - rank.calculate(263, 100).unwrap(); - rank.calculate(476, 100).unwrap(); - rank.calculate(79, 100).unwrap(); - rank.calculate(217, 100).unwrap(); - rank.calculate(177, 100).unwrap(); - rank.calculate(315, 100).unwrap(); - rank.calculate(248, 100).unwrap(); - rank.calculate(502, 100).unwrap(); - rank.calculate(267, 100).unwrap(); - rank.calculate(510, 100).unwrap(); - rank.calculate(228, 100).unwrap(); - rank.calculate(442, 100).unwrap(); - rank.calculate(65, 100).unwrap(); - rank.calculate(70, 100).unwrap(); - rank.calculate(203, 100).unwrap(); - rank.calculate(319, 100).unwrap(); - rank.calculate(62, 100).unwrap(); - rank.calculate(378, 100).unwrap(); - rank.calculate(423, 100).unwrap(); - rank.calculate(444, 100).unwrap(); - rank.calculate(471, 100).unwrap(); - rank.calculate(480, 100).unwrap(); - rank.calculate(151, 100).unwrap(); - rank.calculate(282, 100).unwrap(); - rank.calculate(489, 100).unwrap(); - rank.calculate(21, 100).unwrap(); - rank.calculate(141, 100).unwrap(); - rank.calculate(114, 100).unwrap(); - rank.calculate(59, 100).unwrap(); - rank.calculate(306, 100).unwrap(); - rank.calculate(325, 100).unwrap(); - rank.calculate(219, 100).unwrap(); - rank.calculate(280, 100).unwrap(); - rank.calculate(57, 100).unwrap(); - rank.calculate(221, 100).unwrap(); - rank.calculate(506, 100).unwrap(); - rank.calculate(410, 100).unwrap(); - rank.calculate(67, 100).unwrap(); - rank.calculate(91, 100).unwrap(); - rank.calculate(113, 100).unwrap(); - rank.calculate(425, 100).unwrap(); - rank.calculate(198, 100).unwrap(); - rank.calculate(272, 100).unwrap(); - rank.calculate(353, 100).unwrap(); - rank.calculate(451, 100).unwrap(); - rank.calculate(494, 100).unwrap(); - rank.calculate(456, 100).unwrap(); - rank.calculate(513, 100).unwrap(); - rank.calculate(53, 100).unwrap(); - rank.calculate(526, 100).unwrap(); - rank.calculate(420, 100).unwrap(); - rank.calculate(80, 100).unwrap(); - rank.calculate(2, 100).unwrap(); - rank.calculate(498, 100).unwrap(); - rank.calculate(499, 100).unwrap(); - rank.calculate(509, 100).unwrap(); - rank.calculate(186, 100).unwrap(); - rank.calculate(234, 100).unwrap(); - rank.calculate(430, 100).unwrap(); - rank.calculate(224, 100).unwrap(); - rank.calculate(222, 100).unwrap(); - rank.calculate(28, 100).unwrap(); - rank.calculate(415, 100).unwrap(); - rank.calculate(447, 100).unwrap(); - rank.calculate(257, 100).unwrap(); - rank.calculate(427, 100).unwrap(); - rank.calculate(487, 100).unwrap(); - rank.calculate(180, 100).unwrap(); - rank.calculate(133, 100).unwrap(); - rank.calculate(417, 100).unwrap(); - rank.calculate(532, 100).unwrap(); - rank.calculate(524, 100).unwrap(); - rank.calculate(483, 100).unwrap(); - rank.calculate(297, 100).unwrap(); - rank.calculate(68, 100).unwrap(); - rank.calculate(226, 100).unwrap(); - rank.calculate(463, 100).unwrap(); - rank.calculate(99, 100).unwrap(); - rank.calculate(403, 100).unwrap(); - rank.calculate(441, 100).unwrap(); - rank.calculate(77, 100).unwrap(); - rank.calculate(85, 100).unwrap(); - rank.calculate(348, 100).unwrap(); - rank.calculate(504, 100).unwrap(); - rank.calculate(12, 100).unwrap(); - rank.calculate(388, 100).unwrap(); - rank.calculate(342, 100).unwrap(); - rank.calculate(362, 100).unwrap(); - rank.calculate(534, 100).unwrap(); - rank.calculate(333, 100).unwrap(); - rank.calculate(200, 100).unwrap(); - rank.calculate(384, 100).unwrap(); - rank.calculate(33, 100).unwrap(); - rank.calculate(440, 100).unwrap(); - rank.calculate(475, 100).unwrap(); - rank.calculate(460, 100).unwrap(); - rank.calculate(517, 100).unwrap(); - rank.calculate(255, 100).unwrap(); - rank.calculate(537, 100).unwrap(); - rank.calculate(275, 100).unwrap(); - rank.calculate(145, 100).unwrap(); - rank.calculate(87, 100).unwrap(); - rank.calculate(434, 100).unwrap(); - rank.calculate(39, 100).unwrap(); - rank.calculate(262, 100).unwrap(); - rank.calculate(285, 100).unwrap(); - rank.calculate(469, 100).unwrap(); - rank.calculate(390, 100).unwrap(); - rank.calculate(343, 100).unwrap(); - rank.calculate(36, 100).unwrap(); - rank.calculate(52, 100).unwrap(); - rank.calculate(90, 100).unwrap(); - rank.calculate(15, 100).unwrap(); - rank.calculate(421, 100).unwrap(); - rank.calculate(196, 100).unwrap(); - rank.calculate(163, 100).unwrap(); - rank.calculate(400, 100).unwrap(); - rank.calculate(505, 100).unwrap(); - rank.calculate(422, 100).unwrap(); - rank.calculate(330, 100).unwrap(); - rank.calculate(464, 100).unwrap(); - rank.calculate(11, 100).unwrap(); - rank.calculate(47, 100).unwrap(); - rank.calculate(314, 100).unwrap(); - rank.calculate(76, 100).unwrap(); - rank.calculate(344, 100).unwrap(); - rank.calculate(520, 100).unwrap(); - rank.calculate(459, 100).unwrap(); - rank.calculate(218, 100).unwrap(); - rank.calculate(536, 100).unwrap(); - rank.calculate(492, 100).unwrap(); - rank.calculate(149, 100).unwrap(); - rank.calculate(120, 100).unwrap(); - rank.calculate(323, 100).unwrap(); - rank.calculate(346, 100).unwrap(); - rank.calculate(3, 100).unwrap(); - rank.calculate(104, 100).unwrap(); - rank.calculate(19, 100).unwrap(); - rank.calculate(63, 100).unwrap(); - rank.calculate(107, 100).unwrap(); - rank.calculate(481, 100).unwrap(); - rank.calculate(138, 100).unwrap(); - rank.calculate(23, 100).unwrap(); - rank.calculate(153, 100).unwrap(); - rank.calculate(207, 100).unwrap(); - rank.calculate(411, 100).unwrap(); - rank.calculate(193, 100).unwrap(); - rank.calculate(232, 100).unwrap(); - rank.calculate(327, 100).unwrap(); - rank.calculate(512, 100).unwrap(); - rank.calculate(159, 100).unwrap(); - rank.calculate(105, 100).unwrap(); - rank.calculate(48, 100).unwrap(); - rank.calculate(270, 100).unwrap(); - rank.calculate(9, 100).unwrap(); - rank.calculate(393, 100).unwrap(); - rank.calculate(529, 100).unwrap(); - rank.calculate(350, 100).unwrap(); - rank.calculate(472, 100).unwrap(); - rank.calculate(181, 100).unwrap(); - rank.calculate(380, 100).unwrap(); - rank.calculate(414, 100).unwrap(); - rank.calculate(197, 100).unwrap(); - rank.calculate(189, 100).unwrap(); - rank.calculate(431, 100).unwrap(); - rank.calculate(110, 100).unwrap(); - rank.calculate(284, 100).unwrap(); - rank.calculate(426, 100).unwrap(); - rank.calculate(142, 100).unwrap(); - rank.calculate(259, 100).unwrap(); - rank.calculate(303, 100).unwrap(); - rank.calculate(402, 100).unwrap(); - rank.calculate(211, 100).unwrap(); - rank.calculate(283, 100).unwrap(); - rank.calculate(288, 100).unwrap(); - rank.calculate(392, 100).unwrap(); - rank.calculate(281, 100).unwrap(); - rank.calculate(478, 100).unwrap(); - rank.calculate(215, 100).unwrap(); - rank.calculate(385, 100).unwrap(); - rank.calculate(528, 100).unwrap(); - rank.calculate(82, 100).unwrap(); - rank.calculate(474, 100).unwrap(); - rank.calculate(117, 100).unwrap(); - rank.calculate(418, 100).unwrap(); - rank.calculate(448, 100).unwrap(); - rank.calculate(150, 100).unwrap(); - rank.calculate(132, 100).unwrap(); - rank.calculate(397, 100).unwrap(); - rank.calculate(467, 100).unwrap(); - rank.calculate(473, 100).unwrap(); - rank.calculate(479, 100).unwrap(); - rank.calculate(27, 100).unwrap(); - rank.calculate(29, 100).unwrap(); - rank.calculate(386, 100).unwrap(); - rank.calculate(195, 100).unwrap(); - rank.calculate(497, 100).unwrap(); - rank.calculate(500, 100).unwrap(); - rank.calculate(69, 100).unwrap(); - rank.calculate(531, 100).unwrap(); - rank.calculate(454, 100).unwrap(); - rank.calculate(349, 100).unwrap(); - rank.calculate(522, 100).unwrap(); + rank.calculate(253, numwalks).unwrap(); + rank.calculate(299, numwalks).unwrap(); + rank.calculate(407, numwalks).unwrap(); + rank.calculate(433, numwalks).unwrap(); + rank.calculate(312, numwalks).unwrap(); + rank.calculate(477, numwalks).unwrap(); + rank.calculate(45, numwalks).unwrap(); + rank.calculate(508, numwalks).unwrap(); + rank.calculate(102, numwalks).unwrap(); + rank.calculate(287, numwalks).unwrap(); + rank.calculate(124, numwalks).unwrap(); + rank.calculate(356, numwalks).unwrap(); + rank.calculate(507, numwalks).unwrap(); + rank.calculate(523, numwalks).unwrap(); + rank.calculate(332, numwalks).unwrap(); + rank.calculate(355, numwalks).unwrap(); + rank.calculate(367, numwalks).unwrap(); + rank.calculate(370, numwalks).unwrap(); + rank.calculate(527, numwalks).unwrap(); + rank.calculate(245, numwalks).unwrap(); + rank.calculate(238, numwalks).unwrap(); + rank.calculate(413, numwalks).unwrap(); + rank.calculate(108, numwalks).unwrap(); + rank.calculate(122, numwalks).unwrap(); + rank.calculate(518, numwalks).unwrap(); + rank.calculate(443, numwalks).unwrap(); + rank.calculate(439, numwalks).unwrap(); + rank.calculate(429, numwalks).unwrap(); + rank.calculate(321, numwalks).unwrap(); + rank.calculate(97, numwalks).unwrap(); + rank.calculate(162, numwalks).unwrap(); + rank.calculate(488, numwalks).unwrap(); + rank.calculate(44, numwalks).unwrap(); + rank.calculate(465, numwalks).unwrap(); + rank.calculate(368, numwalks).unwrap(); + rank.calculate(446, numwalks).unwrap(); + rank.calculate(365, numwalks).unwrap(); + rank.calculate(239, numwalks).unwrap(); + rank.calculate(371, numwalks).unwrap(); + rank.calculate(485, numwalks).unwrap(); + rank.calculate(334, numwalks).unwrap(); + rank.calculate(199, numwalks).unwrap(); + rank.calculate(525, numwalks).unwrap(); + rank.calculate(179, numwalks).unwrap(); + rank.calculate(18, numwalks).unwrap(); + rank.calculate(404, numwalks).unwrap(); + rank.calculate(6, numwalks).unwrap(); + rank.calculate(0, numwalks).unwrap(); + rank.calculate(416, numwalks).unwrap(); + rank.calculate(495, numwalks).unwrap(); + rank.calculate(160, numwalks).unwrap(); + rank.calculate(351, numwalks).unwrap(); + rank.calculate(169, numwalks).unwrap(); + rank.calculate(214, numwalks).unwrap(); + rank.calculate(295, numwalks).unwrap(); + rank.calculate(291, numwalks).unwrap(); + rank.calculate(30, numwalks).unwrap(); + rank.calculate(55, numwalks).unwrap(); + rank.calculate(530, numwalks).unwrap(); + rank.calculate(164, numwalks).unwrap(); + rank.calculate(535, numwalks).unwrap(); + rank.calculate(94, numwalks).unwrap(); + rank.calculate(516, numwalks).unwrap(); + rank.calculate(419, numwalks).unwrap(); + rank.calculate(366, numwalks).unwrap(); + rank.calculate(235, numwalks).unwrap(); + rank.calculate(273, numwalks).unwrap(); + rank.calculate(188, numwalks).unwrap(); + rank.calculate(192, numwalks).unwrap(); + rank.calculate(167, numwalks).unwrap(); + rank.calculate(360, numwalks).unwrap(); + rank.calculate(412, numwalks).unwrap(); + rank.calculate(381, numwalks).unwrap(); + rank.calculate(352, numwalks).unwrap(); + rank.calculate(482, numwalks).unwrap(); + rank.calculate(318, numwalks).unwrap(); + rank.calculate(210, numwalks).unwrap(); + rank.calculate(424, numwalks).unwrap(); + rank.calculate(379, numwalks).unwrap(); + rank.calculate(358, numwalks).unwrap(); + rank.calculate(4, numwalks).unwrap(); + rank.calculate(101, numwalks).unwrap(); + rank.calculate(31, numwalks).unwrap(); + rank.calculate(496, numwalks).unwrap(); + rank.calculate(457, numwalks).unwrap(); + rank.calculate(16, numwalks).unwrap(); + rank.calculate(313, numwalks).unwrap(); + rank.calculate(382, numwalks).unwrap(); + rank.calculate(490, numwalks).unwrap(); + rank.calculate(435, numwalks).unwrap(); + rank.calculate(484, numwalks).unwrap(); + rank.calculate(375, numwalks).unwrap(); + rank.calculate(166, numwalks).unwrap(); + rank.calculate(144, numwalks).unwrap(); + rank.calculate(78, numwalks).unwrap(); + rank.calculate(289, numwalks).unwrap(); + rank.calculate(533, numwalks).unwrap(); + rank.calculate(190, numwalks).unwrap(); + rank.calculate(136, numwalks).unwrap(); + rank.calculate(276, numwalks).unwrap(); + rank.calculate(293, numwalks).unwrap(); + rank.calculate(519, numwalks).unwrap(); + rank.calculate(43, numwalks).unwrap(); + rank.calculate(201, numwalks).unwrap(); + rank.calculate(406, numwalks).unwrap(); + rank.calculate(521, numwalks).unwrap(); + rank.calculate(13, numwalks).unwrap(); + rank.calculate(515, numwalks).unwrap(); + rank.calculate(491, numwalks).unwrap(); + rank.calculate(74, numwalks).unwrap(); + rank.calculate(41, numwalks).unwrap(); + rank.calculate(335, numwalks).unwrap(); + rank.calculate(230, numwalks).unwrap(); + rank.calculate(56, numwalks).unwrap(); + rank.calculate(8, numwalks).unwrap(); + rank.calculate(265, numwalks).unwrap(); + rank.calculate(336, numwalks).unwrap(); + rank.calculate(42, numwalks).unwrap(); + rank.calculate(93, numwalks).unwrap(); + rank.calculate(300, numwalks).unwrap(); + rank.calculate(178, numwalks).unwrap(); + rank.calculate(84, numwalks).unwrap(); + rank.calculate(35, numwalks).unwrap(); + rank.calculate(40, numwalks).unwrap(); + rank.calculate(143, numwalks).unwrap(); + rank.calculate(514, numwalks).unwrap(); + rank.calculate(127, numwalks).unwrap(); + rank.calculate(130, numwalks).unwrap(); + rank.calculate(466, numwalks).unwrap(); + rank.calculate(493, numwalks).unwrap(); + rank.calculate(183, numwalks).unwrap(); + rank.calculate(50, numwalks).unwrap(); + rank.calculate(58, numwalks).unwrap(); + rank.calculate(263, numwalks).unwrap(); + rank.calculate(476, numwalks).unwrap(); + rank.calculate(79, numwalks).unwrap(); + rank.calculate(217, numwalks).unwrap(); + rank.calculate(177, numwalks).unwrap(); + rank.calculate(315, numwalks).unwrap(); + rank.calculate(248, numwalks).unwrap(); + rank.calculate(502, numwalks).unwrap(); + rank.calculate(267, numwalks).unwrap(); + rank.calculate(510, numwalks).unwrap(); + rank.calculate(228, numwalks).unwrap(); + rank.calculate(442, numwalks).unwrap(); + rank.calculate(65, numwalks).unwrap(); + rank.calculate(70, numwalks).unwrap(); + rank.calculate(203, numwalks).unwrap(); + rank.calculate(319, numwalks).unwrap(); + rank.calculate(62, numwalks).unwrap(); + rank.calculate(378, numwalks).unwrap(); + rank.calculate(423, numwalks).unwrap(); + rank.calculate(444, numwalks).unwrap(); + rank.calculate(471, numwalks).unwrap(); + rank.calculate(480, numwalks).unwrap(); + rank.calculate(151, numwalks).unwrap(); + rank.calculate(282, numwalks).unwrap(); + rank.calculate(489, numwalks).unwrap(); + rank.calculate(21, numwalks).unwrap(); + rank.calculate(141, numwalks).unwrap(); + rank.calculate(114, numwalks).unwrap(); + rank.calculate(59, numwalks).unwrap(); + rank.calculate(306, numwalks).unwrap(); + rank.calculate(325, numwalks).unwrap(); + rank.calculate(219, numwalks).unwrap(); + rank.calculate(280, numwalks).unwrap(); + rank.calculate(57, numwalks).unwrap(); + rank.calculate(221, numwalks).unwrap(); + rank.calculate(506, numwalks).unwrap(); + rank.calculate(410, numwalks).unwrap(); + rank.calculate(67, numwalks).unwrap(); + rank.calculate(91, numwalks).unwrap(); + rank.calculate(113, numwalks).unwrap(); + rank.calculate(425, numwalks).unwrap(); + rank.calculate(198, numwalks).unwrap(); + rank.calculate(272, numwalks).unwrap(); + rank.calculate(353, numwalks).unwrap(); + rank.calculate(451, numwalks).unwrap(); + rank.calculate(494, numwalks).unwrap(); + rank.calculate(456, numwalks).unwrap(); + rank.calculate(513, numwalks).unwrap(); + rank.calculate(53, numwalks).unwrap(); + rank.calculate(526, numwalks).unwrap(); + rank.calculate(420, numwalks).unwrap(); + rank.calculate(80, numwalks).unwrap(); + rank.calculate(2, numwalks).unwrap(); + rank.calculate(498, numwalks).unwrap(); + rank.calculate(499, numwalks).unwrap(); + rank.calculate(509, numwalks).unwrap(); + rank.calculate(186, numwalks).unwrap(); + rank.calculate(234, numwalks).unwrap(); + rank.calculate(430, numwalks).unwrap(); + rank.calculate(224, numwalks).unwrap(); + rank.calculate(222, numwalks).unwrap(); + rank.calculate(28, numwalks).unwrap(); + rank.calculate(415, numwalks).unwrap(); + rank.calculate(447, numwalks).unwrap(); + rank.calculate(257, numwalks).unwrap(); + rank.calculate(427, numwalks).unwrap(); + rank.calculate(487, numwalks).unwrap(); + rank.calculate(180, numwalks).unwrap(); + rank.calculate(133, numwalks).unwrap(); + rank.calculate(417, numwalks).unwrap(); + rank.calculate(532, numwalks).unwrap(); + rank.calculate(524, numwalks).unwrap(); + rank.calculate(483, numwalks).unwrap(); + rank.calculate(297, numwalks).unwrap(); + rank.calculate(68, numwalks).unwrap(); + rank.calculate(226, numwalks).unwrap(); + rank.calculate(463, numwalks).unwrap(); + rank.calculate(99, numwalks).unwrap(); + rank.calculate(403, numwalks).unwrap(); + rank.calculate(441, numwalks).unwrap(); + rank.calculate(77, numwalks).unwrap(); + rank.calculate(85, numwalks).unwrap(); + rank.calculate(348, numwalks).unwrap(); + rank.calculate(504, numwalks).unwrap(); + rank.calculate(12, numwalks).unwrap(); + rank.calculate(388, numwalks).unwrap(); + rank.calculate(342, numwalks).unwrap(); + rank.calculate(362, numwalks).unwrap(); + rank.calculate(534, numwalks).unwrap(); + rank.calculate(333, numwalks).unwrap(); + rank.calculate(200, numwalks).unwrap(); + rank.calculate(384, numwalks).unwrap(); + rank.calculate(33, numwalks).unwrap(); + rank.calculate(440, numwalks).unwrap(); + rank.calculate(475, numwalks).unwrap(); + rank.calculate(460, numwalks).unwrap(); + rank.calculate(517, numwalks).unwrap(); + rank.calculate(255, numwalks).unwrap(); + rank.calculate(537, numwalks).unwrap(); + rank.calculate(275, numwalks).unwrap(); + rank.calculate(145, numwalks).unwrap(); + rank.calculate(87, numwalks).unwrap(); + rank.calculate(434, numwalks).unwrap(); + rank.calculate(39, numwalks).unwrap(); + rank.calculate(262, numwalks).unwrap(); + rank.calculate(285, numwalks).unwrap(); + rank.calculate(469, numwalks).unwrap(); + rank.calculate(390, numwalks).unwrap(); + rank.calculate(343, numwalks).unwrap(); + rank.calculate(36, numwalks).unwrap(); + rank.calculate(52, numwalks).unwrap(); + rank.calculate(90, numwalks).unwrap(); + rank.calculate(15, numwalks).unwrap(); + rank.calculate(421, numwalks).unwrap(); + rank.calculate(196, numwalks).unwrap(); + rank.calculate(163, numwalks).unwrap(); + rank.calculate(400, numwalks).unwrap(); + rank.calculate(505, numwalks).unwrap(); + rank.calculate(422, numwalks).unwrap(); + rank.calculate(330, numwalks).unwrap(); + rank.calculate(464, numwalks).unwrap(); + rank.calculate(11, numwalks).unwrap(); + rank.calculate(47, numwalks).unwrap(); + rank.calculate(314, numwalks).unwrap(); + rank.calculate(76, numwalks).unwrap(); + rank.calculate(344, numwalks).unwrap(); + rank.calculate(520, numwalks).unwrap(); + rank.calculate(459, numwalks).unwrap(); + rank.calculate(218, numwalks).unwrap(); + rank.calculate(536, numwalks).unwrap(); + rank.calculate(492, numwalks).unwrap(); + rank.calculate(149, numwalks).unwrap(); + rank.calculate(120, numwalks).unwrap(); + rank.calculate(323, numwalks).unwrap(); + rank.calculate(346, numwalks).unwrap(); + rank.calculate(3, numwalks).unwrap(); + rank.calculate(104, numwalks).unwrap(); + rank.calculate(19, numwalks).unwrap(); + rank.calculate(63, numwalks).unwrap(); + rank.calculate(107, numwalks).unwrap(); + rank.calculate(481, numwalks).unwrap(); + rank.calculate(138, numwalks).unwrap(); + rank.calculate(23, numwalks).unwrap(); + rank.calculate(153, numwalks).unwrap(); + rank.calculate(207, numwalks).unwrap(); + rank.calculate(411, numwalks).unwrap(); + rank.calculate(193, numwalks).unwrap(); + rank.calculate(232, numwalks).unwrap(); + rank.calculate(327, numwalks).unwrap(); + rank.calculate(512, numwalks).unwrap(); + rank.calculate(159, numwalks).unwrap(); + rank.calculate(105, numwalks).unwrap(); + rank.calculate(48, numwalks).unwrap(); + rank.calculate(270, numwalks).unwrap(); + rank.calculate(9, numwalks).unwrap(); + rank.calculate(393, numwalks).unwrap(); + rank.calculate(529, numwalks).unwrap(); + rank.calculate(350, numwalks).unwrap(); + rank.calculate(472, numwalks).unwrap(); + rank.calculate(181, numwalks).unwrap(); + rank.calculate(380, numwalks).unwrap(); + rank.calculate(414, numwalks).unwrap(); + rank.calculate(197, numwalks).unwrap(); + rank.calculate(189, numwalks).unwrap(); + rank.calculate(431, numwalks).unwrap(); + rank.calculate(110, numwalks).unwrap(); + rank.calculate(284, numwalks).unwrap(); + rank.calculate(426, numwalks).unwrap(); + rank.calculate(142, numwalks).unwrap(); + rank.calculate(259, numwalks).unwrap(); + rank.calculate(303, numwalks).unwrap(); + rank.calculate(402, numwalks).unwrap(); + rank.calculate(211, numwalks).unwrap(); + rank.calculate(283, numwalks).unwrap(); + rank.calculate(288, numwalks).unwrap(); + rank.calculate(392, numwalks).unwrap(); + rank.calculate(281, numwalks).unwrap(); + rank.calculate(478, numwalks).unwrap(); + rank.calculate(215, numwalks).unwrap(); + rank.calculate(385, numwalks).unwrap(); + rank.calculate(528, numwalks).unwrap(); + rank.calculate(82, numwalks).unwrap(); + rank.calculate(474, numwalks).unwrap(); + rank.calculate(117, numwalks).unwrap(); + rank.calculate(418, numwalks).unwrap(); + rank.calculate(448, numwalks).unwrap(); + rank.calculate(150, numwalks).unwrap(); + rank.calculate(132, numwalks).unwrap(); + rank.calculate(397, numwalks).unwrap(); + rank.calculate(467, numwalks).unwrap(); + rank.calculate(473, numwalks).unwrap(); + rank.calculate(479, numwalks).unwrap(); + rank.calculate(27, numwalks).unwrap(); + rank.calculate(29, numwalks).unwrap(); + rank.calculate(386, numwalks).unwrap(); + rank.calculate(195, numwalks).unwrap(); + rank.calculate(497, numwalks).unwrap(); + rank.calculate(500, numwalks).unwrap(); + rank.calculate(69, numwalks).unwrap(); + rank.calculate(531, numwalks).unwrap(); + rank.calculate(454, numwalks).unwrap(); + rank.calculate(349, numwalks).unwrap(); + rank.calculate(522, numwalks).unwrap(); let begin = SystemTime::now(); let get_time = || SystemTime::now().duration_since(begin).unwrap().as_millis(); From 6dbb211a8c277de949348372d796c7334e85bc7a Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Thu, 18 Jul 2024 20:00:25 +0200 Subject: [PATCH 11/12] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbfcebd..34a84b0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # MeritRank MeritRank is a Rust library for computing merit scores and rankings in a directed graph. -Original `meritrank` is maintained by [Vladimir Radkevich](https://github.com/vsradkevich). +`meritrank` is maintained by [Intersubjective](https://github.com/intersubjective). ## Compilation options - `MERITRANK_NO_ASSERT=1` - disable runtime asserts for better performance. From d0c5702905989c51c1ec8579f0fde8acddc3f670 Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Thu, 18 Jul 2024 20:05:59 +0200 Subject: [PATCH 12/12] Update cargo --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 228d87b..0a35839 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meritrank" -version = "0.6.0" +version = "0.7.0" edition = "2021" description = "MeritRank algorithm library" license = "MIT"