Tulip  5.0.0
Large graphs analysis and drawing
TriconnectedTest.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 
20 #ifndef TULIP_TRICONNECTEDTEST_H
21 #define TULIP_TRICONNECTEDTEST_H
22 
23 #include <tulip/tuliphash.h>
24 #include <tulip/Observable.h>
25 #include <tulip/Graph.h>
26 
27 namespace tlp {
28 
29 /**
30  * @ingroup Checks
31  * @brief Provides functions to test if a graph is triconnected.
32  **/
33 class TLP_SCOPE TriconnectedTest : private Observable {
34 public:
35 
36  /**
37  * @brief Checks if the graph is triconnected.
38  * Creates a clone sugraph in which to operate, then iterates over the nodes, and deletes them.
39  * Once the node is deleted, checks if the graph is biconnected.
40  * If it is not, then the graph is not triconnected.
41  * If it is, adds back the node and its edges.
42  *
43  * @param graph The graph to check is triconnected.
44  * @return bool True if the graph is triconnected, false otherwise.
45  **/
46  static bool isTriconnected(Graph *graph);
47 
48 private:
50 
51  bool compute(tlp::Graph* graph);
52  // override Observable::treatEvent
53  void treatEvent(const Event&);
54 
55  /**
56  * @brief Singleton instance of this class.
57  **/
58  static TriconnectedTest * instance;
59  /**
60  * @brief Stored results for graphs. When a graph is updated, its entry is removed from the hashmap.
61  **/
62  TLP_HASH_MAP<const Graph*, bool> resultsBuffer;
63 };
64 
65 
66 }
67 #endif
Event is the base class for all events used in the Observation mechanism.
Definition: Observable.h:47
Provides functions to test if a graph is triconnected.
The Observable class is the base of Tulip&#39;s observation system.
Definition: Observable.h:123