pub mod util;
pub mod feasible_tree;
pub mod network_simplex;
use graphlib_rust::Graph;
use crate::{GraphConfig, GraphEdge, GraphNode};
use crate::layout::rank::feasible_tree::feasible_tree;
use crate::layout::rank::network_simplex::network_simplex;
use crate::layout::rank::util::longest_path;
pub fn rank(g: &mut Graph<GraphConfig, GraphNode, GraphEdge>) {
let _ranker = g.graph().ranker.clone();
match _ranker {
Some(ranker) => {
let ranker_str = &*ranker;
if ranker_str == "network-simplex" {
network_simplex(g);
} else if ranker_str == "tight-tree" {
tight_tree_ranker(g);
} else if ranker_str == "longest-path" {
longest_path(g);
}
},
_ => {
network_simplex(g);
}
}
}
fn tight_tree_ranker(g: &mut Graph<GraphConfig, GraphNode, GraphEdge>) {
longest_path(g);
feasible_tree(g);
}