# Changeset 1807:5f2f3d982eba in lemon-0.x

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

Empty graph is (strongly) connected.

File:
1 edited

Unmodified
Added
Removed
• ## lemon/topology.h

 r1800 /// \param graph The undirected graph. /// \return %True when there is path between any two nodes in the graph. /// \warning The empty graph is not connected. /// \note By definition, the empty graph is connected. template bool connected(const UndirGraph& graph) { checkConcept(); typedef typename UndirGraph::NodeIt NodeIt; if (NodeIt(graph) == INVALID) return false; if (NodeIt(graph) == INVALID) return true; Dfs dfs(graph); dfs.run(NodeIt(graph)); /// \param graph The graph. It should be undirected. /// \return The number of components /// \note By definition, the empty graph consists /// of zero connected components. template int countConnectedComponents(const UndirGraph &graph) { /// \see connected /// /// \warning Empty graph is not strongly connected. /// \note By definition, the empty graph is strongly connected. template bool stronglyConnected(const Graph& graph) { checkConcept(); if (NodeIt(graph) == INVALID) return false; if (NodeIt(graph) == INVALID) return true; typedef typename Graph::Node Node; /// \param graph The graph. /// \return The number of components /// \note By definition, the empty graph has zero /// strongly connected components. template int countStronglyConnectedComponents(const Graph& graph) { /// /// \param graph The graph. /// \param compMap A writable node map. The values will be set from 0 to /// the number of the connected components minus one. Each values of the map /// will be set exactly once, the values of a certain component will be /// set continuously. /// \retval compMap A writable node map. The values will be set from 0 to /// the number of the strongly connected components minus one. Each values
Note: See TracChangeset for help on using the changeset viewer.