COIN-OR::LEMON - Graph Library

Changeset 1807:5f2f3d982eba in lemon-0.x for lemon/topology.h


Ignore:
Timestamp:
11/16/05 14:26:04 (18 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2350
Message:

Empty graph is (strongly) connected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/topology.h

    r1800 r1807  
    4949  /// \param graph The undirected graph.
    5050  /// \return %True when there is path between any two nodes in the graph.
    51   /// \warning The empty graph is not connected.
     51  /// \note By definition, the empty graph is connected.
    5252  template <typename UndirGraph>
    5353  bool connected(const UndirGraph& graph) {
    5454    checkConcept<concept::UndirGraph, UndirGraph>();
    5555    typedef typename UndirGraph::NodeIt NodeIt;
    56     if (NodeIt(graph) == INVALID) return false;
     56    if (NodeIt(graph) == INVALID) return true;
    5757    Dfs<UndirGraph> dfs(graph);
    5858    dfs.run(NodeIt(graph));
     
    7373  /// \param graph The graph. It should be undirected.
    7474  /// \return The number of components
     75  /// \note By definition, the empty graph consists
     76  /// of zero connected components.
    7577  template <typename UndirGraph>
    7678  int countConnectedComponents(const UndirGraph &graph) {
     
    238240  /// \see connected
    239241  ///
    240   /// \warning Empty graph is not strongly connected.
     242  /// \note By definition, the empty graph is strongly connected.
    241243  template <typename Graph>
    242244  bool stronglyConnected(const Graph& graph) {
    243245    checkConcept<concept::StaticGraph, Graph>();
    244     if (NodeIt(graph) == INVALID) return false;
     246    if (NodeIt(graph) == INVALID) return true;
    245247
    246248    typedef typename Graph::Node Node;
     
    294296  /// \param graph The graph.
    295297  /// \return The number of components
     298  /// \note By definition, the empty graph has zero
     299  /// strongly connected components.
    296300  template <typename Graph>
    297301  int countStronglyConnectedComponents(const Graph& graph) {
     
    357361  ///
    358362  /// \param graph The graph.
    359   /// \param compMap A writable node map. The values will be set from 0 to
    360   /// the number of the connected components minus one. Each values of the map
    361   /// will be set exactly once, the values of a certain component will be
    362   /// set continuously.
    363363  /// \retval compMap A writable node map. The values will be set from 0 to
    364364  /// the number of the strongly connected components minus one. Each values
Note: See TracChangeset for help on using the changeset viewer.