Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type > Class Template Reference

#include <ogdf/planarity/MaximalPlanarSubgraphSimple.h>

+ Inheritance diagram for ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >:

Public Member Functions

 MaximalPlanarSubgraphSimple ()
 Constructor.
 
 MaximalPlanarSubgraphSimple (PlanarSubgraphModule< TCost > &heuristic, double randomness=0.0, unsigned int runs=1)
 Constructor.
 
virtual ~MaximalPlanarSubgraphSimple ()
 Destructor.
 
virtual MaximalPlanarSubgraphSimpleclone () const override
 Clone method.
 
void setSeed (unsigned seed)
 set seed of std::default_random_engine generator to use when randomness > 0
 
- Public Member Functions inherited from ogdf::PlanarSubgraphModule< TCost >
 PlanarSubgraphModule ()
 Initializes a planar subgraph module (default constructor).
 
ReturnType call (const Graph &G, const EdgeArray< TCost > &cost, const List< edge > &preferredEdges, List< edge > &delEdges, bool preferredImplyPlanar=false)
 Returns the set of edges delEdges which have to be deleted to obtain the planar subgraph.
 
ReturnType call (const Graph &G, const EdgeArray< TCost > &cost, List< edge > &delEdges)
 Returns the set of edges delEdges which have to be deleted to obtain the planar subgraph.
 
ReturnType call (const Graph &G, const List< edge > &preferredEdges, List< edge > &delEdges, bool preferredImplyPlanar=false)
 Returns the set of edges delEdges which have to be deleted to obtain the planar subgraph.
 
ReturnType call (const Graph &G, List< edge > &delEdges)
 Returns the set of edges delEdges which have to be deleted to obtain the planar subgraph.
 
ReturnType callAndDelete (GraphCopy &GC, const List< edge > &preferredEdges, List< edge > &delOrigEdges, bool preferredImplyPlanar=false)
 Makes GC planar by deleting edges.
 
ReturnType callAndDelete (GraphCopy &GC, List< edge > &delOrigEdges)
 Makes G planar by deleting edges.
 
unsigned int maxThreads () const
 Returns the maximal number of used threads.
 
void maxThreads (unsigned int n)
 Sets the maximal number of used threads to n.
 
ReturnType operator() (const Graph &G, const List< edge > &preferredEdges, List< edge > &delEdges, bool preferredImplyPlanar=false)
 Returns the set of edges delEdges which have to be deleted to obtain the planar subgraph.
 
ReturnType operator() (const Graph &G, List< edge > &delEdges)
 Returns the set of edges delEdges which have to be deleted to obtain the planar subgraph.
 
- Public Member Functions inherited from ogdf::Module
 Module ()
 Initializes a module.
 
virtual ~Module ()
 
- Public Member Functions inherited from ogdf::Timeouter
 Timeouter ()
 timeout is turned of by default
 
 Timeouter (bool t)
 timeout is turned off (false) or on (true) (with 0 second)
 
 Timeouter (const Timeouter &t)
 
 Timeouter (double t)
 timeout is set to the given value (seconds)
 
 ~Timeouter ()
 
bool isTimeLimit () const
 returns whether any time limit is set or not
 
Timeouteroperator= (const Timeouter &t)
 
double timeLimit () const
 returns the current time limit for the call
 
void timeLimit (bool t)
 shorthand to turn timelimit off or on (with 0 seconds)
 
void timeLimit (double t)
 sets the time limit for the call (in seconds); <0 means no limit.
 

Protected Member Functions

virtual Module::ReturnType doCall (const Graph &graph, const List< edge > &preferredEdges, List< edge > &delEdges, const EdgeArray< TCost > *pCost, bool preferredImplyPlanar) override
 Computes the set of edges delEdges which have to be deleted to obtain the planar subgraph.
 

Private Member Functions

TCost weightOfList (const List< edge > &list, const EdgeArray< TCost > &weights)
 

Private Attributes

bool m_deleteHeuristic
 flag to store we have to delete a self created heuristic
 
PlanarSubgraphModule< TCost > & m_heuristic
 user given heuristic
 
std::default_random_engine m_randomGenerator
 random generator to use with std::uniform_real_distribution
 
double m_randomness
 randomness of the process: use 0 to compute everything based on the costs, use 1 for completely randomness
 
unsigned int m_runs
 number of runs when algorithms is randomized
 

Additional Inherited Members

- Public Types inherited from ogdf::Module
enum class  ReturnType { Feasible , Optimal , NoFeasibleSolution , TimeoutFeasible , TimeoutInfeasible , Error }
 The return type of a module. More...
 
- Static Public Member Functions inherited from ogdf::Module
static bool isSolution (ReturnType ret)
 Returns true iff ret indicates that the module returned a feasible solution.
 
- Protected Attributes inherited from ogdf::Timeouter
double m_timeLimit
 Time limit for module calls (< 0 means no limit).
 

Detailed Description

template<typename TCost>
class ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >

Definition at line 135 of file MaximalPlanarSubgraphSimple.h.

Constructor & Destructor Documentation

◆ MaximalPlanarSubgraphSimple() [1/2]

template<typename TCost >
ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::MaximalPlanarSubgraphSimple ( )
inline

Constructor.

Default constructor with PlanarSubgraphEmpty as pre-executed heuristic before the extension to maximality. randomness is set to 0 and runs is set to 1

Definition at line 144 of file MaximalPlanarSubgraphSimple.h.

◆ MaximalPlanarSubgraphSimple() [2/2]

template<typename TCost >
ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::MaximalPlanarSubgraphSimple ( PlanarSubgraphModule< TCost > &  heuristic,
double  randomness = 0.0,
unsigned int  runs = 1 
)
inlineexplicit

Constructor.

Parameters
heuristicuser given instance of PlanarSubgraphModule that is executed before extending the solution to maximality.
randomnessrandomness of the process: use 0 to compute everything based on the costs, use 1 for completely randomness
runsnumber of runs when randomness > 0, the best solution is returned by call

Definition at line 157 of file MaximalPlanarSubgraphSimple.h.

◆ ~MaximalPlanarSubgraphSimple()

template<typename TCost >
virtual ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::~MaximalPlanarSubgraphSimple ( )
inlinevirtual

Destructor.

Definition at line 168 of file MaximalPlanarSubgraphSimple.h.

Member Function Documentation

◆ clone()

template<typename TCost >
virtual MaximalPlanarSubgraphSimple * ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::clone ( ) const
inlineoverridevirtual

Clone method.

Implements ogdf::PlanarSubgraphModule< TCost >.

Definition at line 175 of file MaximalPlanarSubgraphSimple.h.

◆ doCall()

template<typename TCost >
virtual Module::ReturnType ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::doCall ( const Graph graph,
const List< edge > &  preferredEdges,
List< edge > &  delEdges,
const EdgeArray< TCost > *  pCost,
bool  preferredImplyPlanar 
)
inlineoverrideprotectedvirtual

Computes the set of edges delEdges which have to be deleted to obtain the planar subgraph.

Parameters
graphis the input graph.
preferredEdgesare edges that should be contained in the planar subgraph.
delEdgesis the set of edges that need to be deleted to obtain the planar subgraph.
pCostis apointer to an edge array containing the edge costs; this pointer can be 0 if no costs are given (all edges have cost 1).
preferredImplyPlanarindicates that the edges preferredEdges induce a planar graph.

Implements ogdf::PlanarSubgraphModule< TCost >.

Definition at line 199 of file MaximalPlanarSubgraphSimple.h.

◆ setSeed()

template<typename TCost >
void ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::setSeed ( unsigned  seed)
inline

set seed of std::default_random_engine generator to use when randomness > 0

Parameters
seeduser given seed value

Definition at line 186 of file MaximalPlanarSubgraphSimple.h.

◆ weightOfList()

template<typename TCost >
TCost ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::weightOfList ( const List< edge > &  list,
const EdgeArray< TCost > &  weights 
)
inlineprivate
Parameters
listlist of edges to sum over
weightsEdgeArray with weights
Returns
sum the values in weights over the given list list

Definition at line 298 of file MaximalPlanarSubgraphSimple.h.

Member Data Documentation

◆ m_deleteHeuristic

template<typename TCost >
bool ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::m_deleteHeuristic
private

flag to store we have to delete a self created heuristic

Definition at line 288 of file MaximalPlanarSubgraphSimple.h.

◆ m_heuristic

template<typename TCost >
PlanarSubgraphModule<TCost>& ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::m_heuristic
private

user given heuristic

Definition at line 287 of file MaximalPlanarSubgraphSimple.h.

◆ m_randomGenerator

template<typename TCost >
std::default_random_engine ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::m_randomGenerator
private

random generator to use with std::uniform_real_distribution

Definition at line 290 of file MaximalPlanarSubgraphSimple.h.

◆ m_randomness

template<typename TCost >
double ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::m_randomness
private

randomness of the process: use 0 to compute everything based on the costs, use 1 for completely randomness

Definition at line 289 of file MaximalPlanarSubgraphSimple.h.

◆ m_runs

template<typename TCost >
unsigned int ogdf::MaximalPlanarSubgraphSimple< TCost, typename std::enable_if< std::is_floating_point< TCost >::value >::type >::m_runs
private

number of runs when algorithms is randomized

Definition at line 291 of file MaximalPlanarSubgraphSimple.h.


The documentation for this class was generated from the following file: