Skip to content

Commit db38311

Browse files
committed
Moved visits to webgraph from webgraph_algo
1 parent cc12221 commit db38311

File tree

24 files changed

+46
-43
lines changed

24 files changed

+46
-43
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ serde_json = "1.0.137"
3636
zstd = "0.13"
3737
value-traits = "0.1.4"
3838
thiserror = "2.0.12"
39+
no-break = "0.1.2"
40+
nonmax = "0.5.5"
3941

4042
[profile.release]
4143
opt-level = 3 # like --release

algo/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ rand.workspace = true
3030
log.workspace = true
3131
rayon.workspace = true
3232
sync-cell-slice.workspace = true
33+
no-break.workspace = true
34+
nonmax.workspace = true
3335

34-
nonmax = "0.5.5"
3536
sealed = "0.6.0"
3637
thiserror = "2.0.12"
37-
parallel_frontier = "0.1.1"
38-
no-break = "0.1.2"
3938
kahan = "0.1.4"
4039

4140
[features]

algo/src/acyclicity.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
66
*/
77

8-
use crate::{
9-
visits::depth_first::{EventPred, SeqPath},
10-
visits::{Sequential, StoppedWhenDone},
11-
};
128
use dsi_progress_logger::prelude::*;
139
use std::ops::ControlFlow::{Break, Continue};
1410
use webgraph::traits::RandomAccessGraph;
11+
use webgraph::{
12+
visits::depth_first::{EventPred, SeqPath},
13+
visits::{Sequential, StoppedWhenDone},
14+
};
1515

1616
/// Returns whether the graph is acyclic.
1717
///

algo/src/distances/exact_sum_sweep/computer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ use crate::{
99
distances::exact_sum_sweep::scc_graph::SccGraph,
1010
sccs::{self, Sccs},
1111
utils::math,
12-
visits::{
13-
breadth_first::{EventNoPred, ParFairNoPred},
14-
FilterArgs, Parallel,
15-
},
1612
};
1713
use dsi_progress_logger::*;
1814
use no_break::NoBreak;
@@ -28,6 +24,10 @@ use std::{
2824
use sux::bits::AtomicBitVec;
2925
use sync_cell_slice::SyncSlice;
3026
use webgraph::traits::RandomAccessGraph;
27+
use webgraph::visits::{
28+
breadth_first::{EventNoPred, ParFairNoPred},
29+
FilterArgs, Parallel,
30+
};
3131

3232
use super::{Level, Missing};
3333

algo/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,9 @@ pub mod sccs;
1919
mod top_sort;
2020
pub use top_sort::top_sort;
2121
pub mod distances;
22-
pub mod visits;
2322
pub mod prelude {
2423
pub use crate::acyclicity::is_acyclic;
2524
pub use crate::sccs::*;
2625
pub use crate::thread_pool;
2726
pub use crate::top_sort::top_sort;
28-
pub use crate::visits::breadth_first;
29-
pub use crate::visits::depth_first;
30-
pub use crate::visits::*;
3127
}

algo/src/sccs/kosaraju.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
*/
77

88
use super::Sccs;
9-
use crate::{
10-
prelude::*,
11-
visits::depth_first::{EventNoPred, SeqNoPred},
12-
};
9+
use crate::prelude::*;
1310
use dsi_progress_logger::ProgressLog;
1411
use no_break::NoBreak;
1512
use std::ops::ControlFlow::Continue;
1613
use webgraph::traits::RandomAccessGraph;
14+
use webgraph::visits::{
15+
depth_first::{EventNoPred, SeqNoPred},
16+
Sequential,
17+
};
1718

1819
/// Computes the strongly connected components of a graph using Kosaraju's algorithm.
1920
///

algo/src/sccs/symm_par.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
* SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
66
*/
77

8-
use crate::{
9-
prelude::*,
10-
visits::breadth_first::{EventNoPred, ParFairNoPred},
11-
};
8+
use crate::prelude::*;
129
use dsi_progress_logger::ConcurrentProgressLog;
1310
use no_break::NoBreak;
1411
use rayon::ThreadPool;
@@ -19,6 +16,10 @@ use std::{
1916
};
2017
use sync_cell_slice::SyncSlice;
2118
use webgraph::traits::RandomAccessGraph;
19+
use webgraph::visits::{
20+
breadth_first::{EventNoPred, ParFairNoPred},
21+
Parallel,
22+
};
2223

2324
/// Connected components of symmetric graphs by parallel visits.
2425
pub fn symm_par(

algo/src/sccs/symm_seq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
*/
77

88
use super::Sccs;
9-
use crate::prelude::*;
109
use dsi_progress_logger::ProgressLog;
1110
use no_break::NoBreak;
1211
use std::ops::ControlFlow::Continue;
1312
use webgraph::traits::RandomAccessGraph;
13+
use webgraph::{prelude::*, visits::Sequential};
1414

1515
/// Connected components of symmetric graphs by sequential visits.
1616
pub fn symm_seq(graph: impl RandomAccessGraph, pl: &mut impl ProgressLog) -> Sccs {

algo/src/sccs/tarjan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
*/
77

88
use super::Sccs;
9-
use crate::visits::{depth_first::*, Sequential, StoppedWhenDone};
109
use dsi_progress_logger::ProgressLog;
1110
use std::ops::ControlFlow::{Break, Continue};
1211
use sux::bits::BitVec;
1312
use webgraph::traits::RandomAccessGraph;
13+
use webgraph::visits::{depth_first::*, Sequential, StoppedWhenDone};
1414

1515
/// Tarjan's algorithm for strongly connected components.
1616
pub fn tarjan(graph: impl RandomAccessGraph, pl: &mut impl ProgressLog) -> Sccs {

algo/src/top_sort.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
* SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
66
*/
77

8-
use crate::{
9-
visits::depth_first::SeqPred,
10-
visits::{depth_first::*, Sequential},
11-
};
128
use dsi_progress_logger::ProgressLog;
139
use no_break::NoBreak;
1410
use std::ops::ControlFlow::Continue;
1511
use webgraph::traits::RandomAccessGraph;
12+
use webgraph::{
13+
visits::depth_first::SeqPred,
14+
visits::{depth_first::*, Sequential},
15+
};
1616

1717
/// Returns the node of the graph in topological-sort order, if the graph is
1818
/// acyclic.

0 commit comments

Comments
 (0)