class AtCoder::Graph(NodeInfo, EdgeInfo)

Direct Known Subclasses

Defined in:

graph.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(nodes : Array(NodeInfo)) #

[View source]
def self.new(size : Int64, initial_node : NodeInfo = nil) #

[View source]

Instance Method Detail

def dfs(node : Int64, initial_value : T, &block : Int64, T, NamedTuple(node: Int64, node_info: NodeInfo | Nil, edge: Int64 | Nil, edge_info: EdgeInfo | Nil, parent: Int64), T -> -> ) forall T #

[View source]
def dijkstra(start_node) #

Performs Dijkstra's Algorithm to calculate the distance of each node from start_node. To use this method, EdgeInfo must implement .zero and #+(EdgeInfo) and #>(EdgeInfo).


[View source]
def visited : Set(Int64) #

[View source]