diff --git a/crates/uv-resolver/src/resolution/display.rs b/crates/uv-resolver/src/resolution/display.rs index 04532ba84709..f5f0acf667e8 100644 --- a/crates/uv-resolver/src/resolution/display.rs +++ b/crates/uv-resolver/src/resolution/display.rs @@ -360,11 +360,12 @@ fn propagate_markers(mut graph: IntermediatePetGraph) -> IntermediatePetGraph { // TODO(charlie): The above reasoning could be incorrect. Consider using a graph algorithm that // can handle weight propagation with cycles. let edges = { - let fas = greedy_feedback_arc_set(&graph) + let mut fas = greedy_feedback_arc_set(&graph) .map(|edge| edge.id()) .collect::>(); + fas.sort_unstable(); let mut edges = Vec::with_capacity(fas.len()); - for edge_id in fas { + for edge_id in fas.into_iter().rev() { edges.push(graph.edge_endpoints(edge_id).unwrap()); graph.remove_edge(edge_id); }