pub fn reorder(kahypar_path: &Path, kahypar_ini_path: &Path, graph: &DependencyGraph) -> Result<Vec<usize>, MercError> {
fn reorder_with<P: Partitioner>(partitioner: &P, graph: &DependencyGraph) -> Result<Vec<usize>, MercError> {
/// Weights for each vertex in the hypergraph (real vertices followed by the two pseudo-vertices).
// Calculate the total number of edges that the vertex is involved in, and use it as the weight.
/// Adds an edge to the hypergraph, while ensuring that it is not a self-loop, empty, or duplicated.
fn run_kahypar(kahypar_path: &Path, kahypar_ini_path: &Path, hypergraph: &Hypergraph) -> Result<(), MercError> {
File::create_new(HYPERGRAPH_FILE).map_err(|e| format!("Failed to create file '{HYPERGRAPH_FILE}': {e}"))?;
fn graph_from(num_vertices: usize, relations: &[(Vec<usize>, Vec<usize>)]) -> DependencyGraph {