Skip to content

Commit 852a10c

Browse files
committed
use shortest paths as subroutine in approx centrality
1 parent 38362b7 commit 852a10c

File tree

14 files changed

+154
-627
lines changed

14 files changed

+154
-627
lines changed

crates/core/src/ampc/dht/value.rs

-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ pub trait ValueTrait: TryFrom<Value> + Into<Value> {}
2222

2323
impl ValueTrait for String {}
2424

25-
type ApproxHarmonicMeta = crate::entrypoint::ampc::approximated_harmonic_centrality::Meta;
26-
impl ValueTrait for ApproxHarmonicMeta {}
27-
2825
type F32 = f32;
2926
impl ValueTrait for F32 {}
3027

@@ -66,7 +63,6 @@ impl ValueTrait for Unit {}
6663
)]
6764
pub enum Value {
6865
String(String),
69-
ApproxHarmonicMeta(ApproxHarmonicMeta),
7066
F32(F32),
7167
F64(F64),
7268
U64(U64),
@@ -105,7 +101,6 @@ macro_rules! impl_from_to_value {
105101
}
106102

107103
impl_from_to_value!(String, String);
108-
impl_from_to_value!(ApproxHarmonicMeta, ApproxHarmonicMeta);
109104
impl_from_to_value!(F32, F32);
110105
impl_from_to_value!(F64, F64);
111106
impl_from_to_value!(U64, U64);

crates/core/src/config/defaults.rs

-4
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ impl ApproxHarmonic {
185185
pub fn max_distance() -> u8 {
186186
7
187187
}
188-
189-
pub fn save_centralities_with_zero() -> bool {
190-
false
191-
}
192188
}
193189

194190
pub struct Webgraph;

crates/core/src/config/mod.rs

-11
Original file line numberDiff line numberDiff line change
@@ -716,17 +716,6 @@ pub struct ApproxHarmonicCoordinatorConfig {
716716

717717
#[serde(default = "defaults::ApproxHarmonic::max_distance")]
718718
pub max_distance: u8,
719-
720-
#[serde(default = "defaults::ApproxHarmonic::save_centralities_with_zero")]
721-
pub save_centralities_with_zero: bool,
722-
}
723-
724-
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
725-
pub struct ApproxHarmonicWorkerConfig {
726-
pub gossip: GossipConfig,
727-
pub shard: ShardId,
728-
pub graph_path: String,
729-
pub host: SocketAddr,
730719
}
731720

732721
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]

crates/core/src/distributed/member.rs

-16
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,14 @@ pub enum Service {
125125
host: SocketAddr,
126126
shard: ShardId,
127127
},
128-
HarmonicCoordinator {
129-
host: SocketAddr,
130-
},
131128
ApproxHarmonicWorker {
132129
host: SocketAddr,
133130
shard: ShardId,
134131
},
135-
ApproxHarmonicCoordinator {
136-
host: SocketAddr,
137-
},
138132
ShortestPathWorker {
139133
host: SocketAddr,
140134
shard: ShardId,
141135
},
142-
ShortestPathCoordinator {
143-
host: SocketAddr,
144-
},
145136
}
146137

147138
impl std::fmt::Display for Service {
@@ -163,19 +154,12 @@ impl std::fmt::Display for Service {
163154
}
164155
Self::Dht { host, shard } => write!(f, "Dht {} {}", host, shard),
165156
Self::HarmonicWorker { host, shard } => write!(f, "HarmonicWorker {} {}", host, shard),
166-
Self::HarmonicCoordinator { host } => write!(f, "HarmonicCoordinator {}", host),
167157
Self::ApproxHarmonicWorker { host, shard } => {
168158
write!(f, "ApproxHarmonicWorker {} {}", host, shard)
169159
}
170-
Self::ApproxHarmonicCoordinator { host } => {
171-
write!(f, "ApproxHarmonicCoordinator {}", host)
172-
}
173160
Self::ShortestPathWorker { host, shard } => {
174161
write!(f, "ShortestPathWorker {} {}", host, shard)
175162
}
176-
Self::ShortestPathCoordinator { host } => {
177-
write!(f, "ShortestPathCoordinator {}", host)
178-
}
179163
}
180164
}
181165
}

0 commit comments

Comments
 (0)