Exemplo n.º 1
0
        private void AddEdgeHelper(int vertex, FlowEdge edge)
        {
            _vertices.Add(vertex);
            _edges.Add(edge);

            if (!_adjacency.ContainsKey(vertex))
            {
                _adjacency.Add(vertex, new List <FlowEdge>());
            }

            _adjacency[vertex].Add(edge);
        }
Exemplo n.º 2
0
 public void AddEdge(FlowEdge e)
 {
     AddEdgeHelper(e.From, e);
     AddEdgeHelper(e.To, e);
 }