Skip to content

Commit

Permalink
DOT graph creation fixed and shows weights.
Browse files Browse the repository at this point in the history
  • Loading branch information
thebracket committed Jan 15, 2025
1 parent f5a2693 commit 327ae0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rust/uisp_integration/src/strategies/full/tree_walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn walk_tree_for_routing(
let mut visited = std::collections::HashSet::new();
let current_node = root_idx;
let mut natural_weights: Vec<RouteOverride> = Vec::new();
let mut dot_graph = "digraph G {\n graph [ ranksep=2.0 overlap=false ]".to_string();
let mut dot_graph = "digraph G {\n graph [ ranksep=2.0 overlap=false ]\n".to_string();
walk_node(current_node, 10, sites, &mut visited, overrides, &mut dot_graph, &mut natural_weights);
dot_graph.push_str("}\n");
{
Expand Down Expand Up @@ -73,7 +73,7 @@ fn walk_node(
let to = sites[idx].name.clone();
if sites[idx].site_type != UispSiteType::Client && sites[i].site_type != UispSiteType::Client
{
dot_graph.push_str(&format!("\"{}\" [label=\"{}\"];\n", to, to));
dot_graph.push_str(&format!("\"{}\" -> \"{}\" [label=\"{}\"] \n", from, to, weight));
natural_weights.push(RouteOverride {
from_site: from.clone(),
to_site: to.clone(),
Expand Down

0 comments on commit 327ae0c

Please sign in to comment.