webgraph_algo/distances/exact_sum_sweep/
output_symm.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
9/// [`run_symm`](super::Level::run_symm) on [`All`](super::All) or
10/// [`AllForward`](super::AllForward).
11#[derive(Debug, Clone, Hash, PartialEq, Eq)]
12pub struct All {
13    /// The eccentricities
14    pub eccentricities: Box<[usize]>,
15    /// The diameter.
16    pub diameter: usize,
17    /// The radius.
18    pub radius: usize,
19    /// A vertex whose eccentricity equals the diameter.
20    pub diametral_vertex: usize,
21    /// A vertex whose eccentricity equals the radius.
22    pub radial_vertex: usize,
23    /// Number of iterations before the radius was found.
24    pub radius_iterations: usize,
25    /// Number of iterations before the diameter was found.
26    pub diameter_iterations: usize,
27    /// Number of iterations before all eccentricities were found.
28    pub iterations: usize,
29}
30
31/// The result returned by
32/// [`run_symm`](super::Level::run_symm) on
33/// [`RadiusDiameter`](super::RadiusDiameter).
34#[derive(Debug, Clone, Hash, PartialEq, Eq)]
35pub struct RadiusDiameter {
36    /// The diameter.
37    pub diameter: usize,
38    /// The radius.
39    pub radius: usize,
40    /// A vertex whose eccentricity equals the diameter.
41    pub diametral_vertex: usize,
42    /// A vertex whose eccentricity equals the radius.
43    pub radial_vertex: usize,
44    /// Number of iterations before the radius was found.
45    pub radius_iterations: usize,
46    /// Number of iterations before the diameter was found.
47    pub diameter_iterations: usize,
48}
49
50/// The result returned by
51/// [`run_symm`](super::Level::run_symm) on
52/// [`Diameter`](super::Diameter).
53#[derive(Debug, Clone, Hash, PartialEq, Eq)]
54pub struct Diameter {
55    /// The diameter.
56    pub diameter: usize,
57    /// A vertex whose eccentricity equals the diameter.
58    pub diametral_vertex: usize,
59    /// Number of iterations before the diameter was found.
60    pub diameter_iterations: usize,
61}
62
63/// The result returned by
64/// [`run_symm`](super::Level::run_symm) on [`Radius`](super::Radius).
65#[derive(Debug, Clone, Hash, PartialEq, Eq)]
66pub struct Radius {
67    /// The radius.
68    pub radius: usize,
69    /// A vertex whose eccentricity equals the radius.
70    pub radial_vertex: usize,
71    /// Number of iterations before the radius was found.
72    pub radius_iterations: usize,
73}