webgraph_algo/distances/exact_sum_sweep/output.rs
1/*
2 * SPDX-FileCopyrightText: 2024 Matteo Dell'Acqua
3 * SPDX-FileCopyrightText: 2025 Sebastiano Vigna
4 *
5 * SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
6 */
7
8/// The result returned by [`run`](super::Level::run) on
9/// [`All`](super::All).
10#[derive(Debug, Clone, Hash, PartialEq, Eq)]
11pub struct All {
12 /// The forward eccentricities
13 pub forward_eccentricities: Box<[usize]>,
14 /// The backward eccentricities
15 pub backward_eccentricities: Box<[usize]>,
16 /// The diameter.
17 pub diameter: usize,
18 /// The radius.
19 pub radius: usize,
20 /// A vertex whose eccentricity equals the diameter.
21 pub diametral_vertex: usize,
22 /// A vertex whose eccentricity equals the radius.
23 pub radial_vertex: usize,
24 /// Number of iterations before the radius was found.
25 pub radius_iterations: usize,
26 /// Number of iterations before the diameter was found.
27 pub diameter_iterations: usize,
28 /// Number of iterations before all forward eccentricities were found.
29 pub forward_iterations: usize,
30 /// Number of iterations before all eccentricities were found.
31 pub all_iterations: usize,
32}
33
34/// The result returned by [`run`](super::Level::run) on
35/// [`AllForward`](super::AllForward).
36#[derive(Debug, Clone, Hash, PartialEq, Eq)]
37pub struct AllForward {
38 /// The forward eccentricities
39 pub forward_eccentricities: Box<[usize]>,
40 /// The diameter.
41 pub diameter: usize,
42 /// The radius.
43 pub radius: usize,
44 /// A vertex whose eccentricity equals the diameter.
45 pub diametral_vertex: usize,
46 /// A vertex whose eccentricity equals the radius.
47 pub radial_vertex: usize,
48 /// Number of iterations before the radius was found.
49 pub radius_iterations: usize,
50 /// Number of iterations before the diameter was found.
51 pub diameter_iterations: usize,
52 /// Number of iterations before all forward eccentricities were found.
53 pub forward_iterations: usize,
54}
55
56/// The result returned by [`run`](super::Level::run) on
57/// [`RadiusDiameter`](super::RadiusDiameter).
58#[derive(Debug, Clone, Hash, PartialEq, Eq)]
59pub struct RadiusDiameter {
60 /// The diameter.
61 pub diameter: usize,
62 /// The radius.
63 pub radius: usize,
64 /// A vertex whose eccentricity equals the diameter.
65 pub diametral_vertex: usize,
66 /// A vertex whose eccentricity equals the radius.
67 pub radial_vertex: usize,
68 /// Number of iterations before the radius was found.
69 pub radius_iterations: usize,
70 /// Number of iterations before the diameter was found.
71 pub diameter_iterations: usize,
72}
73
74/// The result returned by [`run`](super::Level::run) on
75/// [`Diameter`](super::Diameter).
76#[derive(Debug, Clone, Hash, PartialEq, Eq)]
77pub struct Diameter {
78 /// The diameter.
79 pub diameter: usize,
80 /// A vertex whose eccentricity equals the diameter.
81 pub diametral_vertex: usize,
82 /// Number of iterations before the diameter was found.
83 pub diameter_iterations: usize,
84}
85
86/// The result returned by [`run`](super::Level::run) on
87/// [`Radius`](super::Radius).
88#[derive(Debug, Clone, Hash, PartialEq, Eq)]
89pub struct Radius {
90 /// The radius.
91 pub radius: usize,
92 /// A vertex whose eccentricity equals the radius.
93 pub radial_vertex: usize,
94 /// Number of iterations before the radius was found.
95 pub radius_iterations: usize,
96}