Skip to content

Commit f15754e

Browse files
GiggleLiuclaude
andcommitted
chore: update outdated dependencies
Update petgraph 0.6→0.8, thiserror 1.0→2.0, rand 0.8→0.9, criterion 0.5→0.8. Adapt code to API changes: rand trait rename, petgraph type param, criterion black_box. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c439ae3 commit f15754e

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ default = ["ilp"]
1616
ilp = ["good_lp"]
1717

1818
[dependencies]
19-
petgraph = { version = "0.6", features = ["serde-1"] }
19+
petgraph = { version = "0.8", features = ["serde-1"] }
2020
bitvec = "1.0"
2121
serde = { version = "1.0", features = ["derive"] }
2222
serde_json = "1.0"
23-
thiserror = "1.0"
23+
thiserror = "2.0"
2424
num-traits = "0.2"
2525
good_lp = { version = "1.8", default-features = false, features = ["highs"], optional = true }
2626
inventory = "0.3"
2727
ordered-float = "5.0"
28-
rand = "0.8"
28+
rand = "0.9"
2929
problemreductions-macros = { version = "0.1.0", path = "problemreductions-macros" }
3030

3131
[dev-dependencies]
3232
proptest = "1.0"
33-
criterion = "0.5"
33+
criterion = "0.8"
3434

3535
[[bench]]
3636
name = "solver_benchmarks"

benches/solver_benchmarks.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Benchmarks for the BruteForce solver on various problem types.
22
3-
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
3+
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
4+
use std::hint::black_box;
45
use problemreductions::models::graph::*;
56
use problemreductions::topology::SimpleGraph;
67
use problemreductions::models::optimization::*;

src/rules/graph.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,12 @@ impl ReductionGraph {
474474
None => return vec![],
475475
};
476476

477-
let paths: Vec<Vec<NodeIndex>> =
478-
all_simple_paths(&self.graph, src_idx, dst_idx, 0, None).collect();
477+
let paths: Vec<Vec<NodeIndex>> = all_simple_paths::<
478+
Vec<NodeIndex>,
479+
_,
480+
std::hash::RandomState,
481+
>(&self.graph, src_idx, dst_idx, 0, None)
482+
.collect();
479483

480484
paths
481485
.into_iter()

src/rules/unitdiskmapping/pathdecomposition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! Experimental evaluation of a branch and bound algorithm for computing pathwidth.
1515
//! <https://doi.org/10.1007/978-3-319-07959-2_5>
1616
17-
use rand::seq::SliceRandom;
17+
use rand::seq::IndexedRandom;
1818
use std::collections::{HashMap, HashSet};
1919

2020
/// A layout representing a partial path decomposition.
@@ -296,7 +296,7 @@ fn greedy_step(
296296
.map(|(i, _)| i)
297297
.collect();
298298

299-
let mut rng = rand::thread_rng();
299+
let mut rng = rand::rng();
300300
let &chosen_idx = best_indices.as_slice().choose(&mut rng).unwrap();
301301

302302
layouts.into_iter().nth(chosen_idx).unwrap()

0 commit comments

Comments
 (0)