pub struct Tournament {
pub nodes: HashSet<Node>,
pub adjacency: HashMap<Node, Vec<Arc>>,
}
Expand description
A tournament graph where each node has an equal number of incoming and outgoing edges.
Fields§
§nodes: HashSet<Node>
The set of nodes in the tournament.
adjacency: HashMap<Node, Vec<Arc>>
The adjacency list representing outgoing arcs for each node.
Implementations§
Source§impl Tournament
impl Tournament
Sourcepub fn new(arcs: Vec<Tile>) -> Result<Self, String>
pub fn new(arcs: Vec<Tile>) -> Result<Self, String>
Creates a new tournament from a list of directed edges (arcs).
§Arguments
arcs
- A vector of tuples representing directed edges, where the first element is the source node and the second is the destination node.
§Returns
Ok(Tournament)
if the input forms a valid tournament graph.Err(String)
if the input does not satisfy the tournament properties.
Trait Implementations§
Source§impl Clone for Tournament
impl Clone for Tournament
Source§fn clone(&self) -> Tournament
fn clone(&self) -> Tournament
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Tournament
impl Debug for Tournament
Source§impl Default for Tournament
impl Default for Tournament
Source§fn default() -> Tournament
fn default() -> Tournament
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Tournament
impl RefUnwindSafe for Tournament
impl Send for Tournament
impl Sync for Tournament
impl Unpin for Tournament
impl UnwindSafe for Tournament
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more