/// Prints the node and edge count, along with the value each node and edge contains
Prints the node and edge count, along with the value each node and edge contains
Prints the node and edge count along with the value each node and edge contains
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        // Prints node and edge counts.
        writeln!(f, "{} Nodes", self.dim())?;
        writeln!(f, "{} Edges", self.edge_count())?;
        // Prints out nodes.
        for (i, n) in self.raw_nodes().iter().enumerate() {
            write!(f, "Node {}: {}", i, n.weight)?;
        }
        // Prints out edges.
        for (i, e) in self.raw_edges().iter().enumerate() {
            write!(f, "Edge {}: {}", i, e.weight)?;
        }
        Ok(())
    }
fn fmt ( & self , f : & mut std :: fmt :: Formatter < ' _ > ) -> std :: fmt :: Result { // Prints node and edge counts. writeln ! ( f " " self dim ( ) ) ? ; writeln ! ( f " " self edge_count ( ) ) ? ; // Prints out nodes. for ( i , n ) in self . raw_nodes ( ) . iter ( ) . enumerate ( ) { write ! ( f " " i n weight ) ? ; } // Prints out edges. for ( i , e ) in self . raw_edges ( ) . iter ( ) . enumerate ( ) { write ! ( f " " i e weight ) ? ; } Ok ( ( ) ) }
Prints the node and edge count, along with the value each node and edge contains
Prints the node and edge count along with the value each node and edge contains
&self
f
&mut std::fmt::Formatter<'_>