1 use stud_rust_base::{io::*, time::report_time, types::*};
3 use std::{env, error::Error, path::Path};
5 fn main() -> Result<(), Box<dyn Error>> {
6 let arg = &env::args().nth(1).expect("No directory arg given");
7 let path = Path::new(arg);
9 let first_out = Vec::<EdgeId>::load_from(path.join("first_out"))?;
10 let head = Vec::<NodeId>::load_from(path.join("head"))?;
11 let travel_time = Vec::<Weight>::load_from(path.join("travel_time"))?;
13 report_time("iterating over arcs of some node", || {
15 for edge_id in first_out[node_id]..first_out[node_id + 1] {
17 "There is an arc from {} to {} with weight {}",
18 node_id, head[edge_id as usize], travel_time[edge_id as usize]
23 vec![42; 42].write_to(&path.join("distances"))?;