class Cadmium::EdgeWeightedDigraph

Overview

Represents a digraph, you can add an edge, get the number vertexes, edges, get all edges and use #to_s to print the Digraph.

Defined in:

cadmium/graph/edge_weighted_digraph.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

Create a new EdgeWeightedDigraph.


[View source]

Instance Method Detail

def add(from : Int32, to : Int32, weight : Float64) #

Create and add a new DirectedEdge.


[View source]
def add_edge(e : DirectedEdge) #

Add a DirectedEdge.


[View source]
def e : Int32 #

Get the number of edges saved.


[View source]
def edges #

Use callback on all edges.


[View source]
def get_adj(v : Int32) #

Use callback on all edges from v.


[View source]
def to_s(io) #

[View source]
def v #

Get the number of vertexs saved.


[View source]