COIN-OR::LEMON - Graph Library

Changeset 421:54b943063901 in lemon-0.x


Ignore:
Timestamp:
04/26/04 18:58:14 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@561
Message:

For working with undirected graphs, head is changed to aNode.
Some dimacs doki.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/include/dijkstra.h

    r385 r421  
    168168        for(G.first(e, v);
    169169            G.valid(e); G.next(e)) {
    170           Node w=G.head(e);
     170          Node w=G.bNode(e);
    171171         
    172172          switch(heap.state(w)) {
  • src/work/marci/dimacs.h

    r259 r421  
    99namespace hugo {
    1010
     11  /// Dimacs flow files.
     12
     13  /// This function reads a flow instance from dimacs flow format.
     14  /// At the beginning \c g is destroyed by \c g.clear().
     15  /// If the data coming from \c is is a max flow innstance, then
     16  /// \c s and \t will be respectively the source and target nodes
     17  /// and \c capacity will contain the edge capacities.
     18  /// If the data is a shortest path problem then \c s will be the
     19  /// source node and \capacity will contain the edge lengths.
    1120  template<typename Graph, typename CapacityMap>
    12   void readDimacsMaxFlow(std::istream& is, Graph &G, typename Graph::Node &s, typename Graph::Node &t, CapacityMap& capacity) {
    13     G.clear();
     21  void readDimacsMaxFlow(std::istream& is, Graph &g, typename Graph::Node &s, typename Graph::Node &t, CapacityMap& capacity) {
     22    g.clear();
    1423    int cap;
    1524    char d;
     
    3039        getline(is, str);
    3140        nodes.resize(n+1);
    32         for (int k=1; k<=n; ++k) nodes[k]=G.addNode();
     41        for (int k=1; k<=n; ++k) nodes[k]=g.addNode();
    3342        break;
    3443      case 'n': //node definition
     
    4857        is >> i >> j >> cap;
    4958        getline(is, str);
    50         e=G.addEdge(nodes[i], nodes[j]);
     59        e=g.addEdge(nodes[i], nodes[j]);
    5160        capacity.update();
    5261        capacity.set(e, cap);
Note: See TracChangeset for help on using the changeset viewer.