Skip to content

Commit

Permalink
use shortest paths as subroutine in approx centrality
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkeldenker committed Dec 10, 2024
1 parent 38362b7 commit 852a10c
Show file tree
Hide file tree
Showing 14 changed files with 154 additions and 627 deletions.
5 changes: 0 additions & 5 deletions crates/core/src/ampc/dht/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ pub trait ValueTrait: TryFrom<Value> + Into<Value> {}

impl ValueTrait for String {}

type ApproxHarmonicMeta = crate::entrypoint::ampc::approximated_harmonic_centrality::Meta;
impl ValueTrait for ApproxHarmonicMeta {}

type F32 = f32;
impl ValueTrait for F32 {}

Expand Down Expand Up @@ -66,7 +63,6 @@ impl ValueTrait for Unit {}
)]
pub enum Value {
String(String),
ApproxHarmonicMeta(ApproxHarmonicMeta),
F32(F32),
F64(F64),
U64(U64),
Expand Down Expand Up @@ -105,7 +101,6 @@ macro_rules! impl_from_to_value {
}

impl_from_to_value!(String, String);
impl_from_to_value!(ApproxHarmonicMeta, ApproxHarmonicMeta);
impl_from_to_value!(F32, F32);
impl_from_to_value!(F64, F64);
impl_from_to_value!(U64, U64);
Expand Down
4 changes: 0 additions & 4 deletions crates/core/src/config/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ impl ApproxHarmonic {
pub fn max_distance() -> u8 {
7
}

pub fn save_centralities_with_zero() -> bool {
false
}
}

pub struct Webgraph;
Expand Down
11 changes: 0 additions & 11 deletions crates/core/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,17 +716,6 @@ pub struct ApproxHarmonicCoordinatorConfig {

#[serde(default = "defaults::ApproxHarmonic::max_distance")]
pub max_distance: u8,

#[serde(default = "defaults::ApproxHarmonic::save_centralities_with_zero")]
pub save_centralities_with_zero: bool,
}

#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct ApproxHarmonicWorkerConfig {
pub gossip: GossipConfig,
pub shard: ShardId,
pub graph_path: String,
pub host: SocketAddr,
}

#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
Expand Down
16 changes: 0 additions & 16 deletions crates/core/src/distributed/member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,14 @@ pub enum Service {
host: SocketAddr,
shard: ShardId,
},
HarmonicCoordinator {
host: SocketAddr,
},
ApproxHarmonicWorker {
host: SocketAddr,
shard: ShardId,
},
ApproxHarmonicCoordinator {
host: SocketAddr,
},
ShortestPathWorker {
host: SocketAddr,
shard: ShardId,
},
ShortestPathCoordinator {
host: SocketAddr,
},
}

impl std::fmt::Display for Service {
Expand All @@ -163,19 +154,12 @@ impl std::fmt::Display for Service {
}
Self::Dht { host, shard } => write!(f, "Dht {} {}", host, shard),
Self::HarmonicWorker { host, shard } => write!(f, "HarmonicWorker {} {}", host, shard),
Self::HarmonicCoordinator { host } => write!(f, "HarmonicCoordinator {}", host),
Self::ApproxHarmonicWorker { host, shard } => {
write!(f, "ApproxHarmonicWorker {} {}", host, shard)
}
Self::ApproxHarmonicCoordinator { host } => {
write!(f, "ApproxHarmonicCoordinator {}", host)
}
Self::ShortestPathWorker { host, shard } => {
write!(f, "ShortestPathWorker {} {}", host, shard)
}
Self::ShortestPathCoordinator { host } => {
write!(f, "ShortestPathCoordinator {}", host)
}
}
}
}
Expand Down
Loading

0 comments on commit 852a10c

Please sign in to comment.