mod directed;
pub use directed::*;
mod undirected;
use ndarray::prelude::*;
pub use undirected::*;
use crate::types::{Labels, Result, Set};
pub trait Graph {
fn empty<I, V>(labels: I) -> Result<Self>
where
I: IntoIterator<Item = V>,
V: AsRef<str>,
Self: Sized;
fn complete<I, V>(labels: I) -> Result<Self>
where
I: IntoIterator<Item = V>,
V: AsRef<str>,
Self: Sized;
fn vertices(&self) -> Set<usize>;
fn has_vertex(&self, x: usize) -> bool;
fn edges(&self) -> Set<(usize, usize)>;
fn has_edge(&self, x: usize, y: usize) -> Result<bool>;
fn add_edge(&mut self, x: usize, y: usize) -> Result<bool>;
fn del_edge(&mut self, x: usize, y: usize) -> Result<bool>;
fn select(&self, x: &Set<usize>) -> Result<Self>
where
Self: Sized;
fn from_adjacency_matrix(labels: Labels, adjacency_matrix: Array2<bool>) -> Result<Self>
where
Self: Sized;
fn to_adjacency_matrix(&self) -> Array2<bool>;
}