COIN-OR::LEMON - Graph Library

source: lemon-tutorial/demo/hello_lemon.cc @ 54:e99a7fb6bff5

Last change on this file since 54:e99a7fb6bff5 was 54:e99a7fb6bff5, checked in by Peter Kovacs <kpeter@…>, 11 years ago

Port and rework LP demo files from SVN -r3524

File size: 1.2 KB
RevLine 
[5]1/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 *
3 * This file is a part of LEMON, a generic C++ optimization library.
4 *
[36]5 * Copyright (C) 2003-2010
[5]6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
8 *
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
12 *
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
15 * purpose.
16 *
17 */
18
19///\file
[16]20///\brief Simple "Hello World!" program for LEMON.
[5]21///
[16]22/// Simple "Hello World!" program for LEMON.
[54]23///
[5]24/// \include hello_lemon.cc
25
26#include <iostream>
27#include <lemon/list_graph.h>
28
[36]29using namespace lemon;
30using namespace std;
31
[5]32int main()
33{
[36]34  ListDigraph g;
[5]35
[36]36  ListDigraph::Node u = g.addNode();
37  ListDigraph::Node v = g.addNode();
38  ListDigraph::Arc  a = g.addArc(u, v);
[5]39
[36]40  cout << "Hello World! This is LEMON library here." << endl;
41  cout << "We have a directed graph with " << countNodes(g) << " nodes "
42       << "and " << countArcs(g) << " arc." << endl;
[5]43
44  return 0;
45}
Note: See TracBrowser for help on using the repository browser.