use std::collections::HashMap;
use std::hash::Hash;
use crate::core::cluster::Cluster;
use crate::core::graph::Graph;
use distances::Number;
pub type ClusterScores<'a, U> = HashMap<&'a Cluster<U>, f64>;
pub type InstanceScores = HashMap<usize, f64>;
pub trait GraphScorer<'a, U: Number>: Hash {
fn call(&self, _graph: &'a Graph<'a, U>) -> (ClusterScores<'a, U>, Vec<f64>) {
todo!()
}
fn name(&self) -> &str;
fn short_name(&self) -> &str;
fn normalize_on_clusters(&self) -> bool;
fn score_graph(&self, graph: &'a Graph<'a, U>) -> ClusterScores<'a, U>;
fn inherit_scores(&self, _scores: &ClusterScores<U>) -> InstanceScores {
todo!()
}
fn ordered_scores(&self, _scores: &InstanceScores) -> Vec<f64> {
todo!()
}
}
pub struct ClusterCardinality;
impl Hash for ClusterCardinality {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
"cluster_cardinality".hash(state);
}
}
impl<'a, U: Number> GraphScorer<'a, U> for ClusterCardinality {
fn name(&self) -> &str {
"cluster_cardinality"
}
fn short_name(&self) -> &str {
"cc"
}
fn normalize_on_clusters(&self) -> bool {
todo!()
}
fn score_graph(&self, _graph: &'a Graph<'a, U>) -> ClusterScores<'a, U> {
todo!()
}
}
pub struct ComponentCardinality;
impl Hash for ComponentCardinality {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
"component_cardinality".hash(state);
}
}
impl<'a, U: Number> GraphScorer<'a, U> for ComponentCardinality {
fn name(&self) -> &str {
"component_cardinality"
}
fn short_name(&self) -> &str {
"sc"
}
fn normalize_on_clusters(&self) -> bool {
todo!()
}
fn score_graph(&self, _graph: &'a Graph<'a, U>) -> ClusterScores<'a, U> {
todo!()
}
}
pub struct VertexDegree;
impl Hash for VertexDegree {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
"vertex_degree".hash(state);
}
}
impl<'a, U: Number> GraphScorer<'a, U> for VertexDegree {
fn name(&self) -> &str {
"vertex_degree"
}
fn short_name(&self) -> &str {
"vd"
}
fn normalize_on_clusters(&self) -> bool {
todo!()
}
fn score_graph(&self, _graph: &'a Graph<'a, U>) -> ClusterScores<'a, U> {
todo!()
}
}
pub struct ParentCardinality<'a, U: Number> {
#[allow(dead_code)]
root: &'a Cluster<U>,
#[allow(dead_code)]
weight: Box<dyn (Fn(usize) -> f64) + Send + Sync>,
}
impl<'a, U: Number> ParentCardinality<'a, U> {
pub fn new(_root: &'a Cluster<U>) -> Self {
todo!()
}
pub fn ancestry(&self, _c: &'a Cluster<U>) -> Vec<&'a Cluster<U>> {
todo!()
}
}
impl<'a, U: Number> Hash for ParentCardinality<'a, U> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
"parent_cardinality".hash(state);
}
}
impl<'a, U: Number> GraphScorer<'a, U> for ParentCardinality<'a, U> {
fn name(&self) -> &str {
"parent_cardinality"
}
fn short_name(&self) -> &str {
"pc"
}
fn normalize_on_clusters(&self) -> bool {
todo!()
}
fn score_graph(&self, _graph: &'a Graph<'a, U>) -> ClusterScores<'a, U> {
todo!()
}
}
pub struct GraphNeighborhood {
#[allow(dead_code)]
eccentricity_fraction: f64,
}
impl GraphNeighborhood {
#[must_use]
pub const fn new(eccentricity_fraction: f64) -> Self {
Self { eccentricity_fraction }
}
#[allow(dead_code)]
fn num_steps<'a, U: Number>(&self, _graph: &'a Graph<'a, U>, _c: &'a Cluster<U>) -> usize {
todo!()
}
}
impl Hash for GraphNeighborhood {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
"graph_neighborhood".hash(state);
}
}
impl<'a, U: Number> GraphScorer<'a, U> for GraphNeighborhood {
fn name(&self) -> &str {
"graph_neighborhood"
}
fn short_name(&self) -> &str {
"gn"
}
fn normalize_on_clusters(&self) -> bool {
todo!()
}
fn score_graph(&self, _graph: &'a Graph<'a, U>) -> ClusterScores<'a, U> {
todo!()
}
}
pub struct StationaryProbabilities {
#[allow(dead_code)]
num_steps: usize,
}
impl Hash for StationaryProbabilities {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
"stationary_probabilities".hash(state);
}
}
impl StationaryProbabilities {
#[must_use]
pub const fn new(num_steps: usize) -> Self {
Self { num_steps }
}
}
impl<'a, U: Number> GraphScorer<'a, U> for StationaryProbabilities {
fn name(&self) -> &str {
"stationary_probabilities"
}
fn short_name(&self) -> &str {
"sp"
}
fn normalize_on_clusters(&self) -> bool {
todo!()
}
#[allow(unused_variables)]
fn score_graph(&self, graph: &'a Graph<U>) -> ClusterScores<'a, U> {
todo!()
}
}