RingDecomposerLib 1.0
Classes | Macros | Typedefs | Enumerations | Functions | Variables
RingDecomposerLib.h File Reference

This file contains the API of the RingDecomposerLib library. More...

Go to the source code of this file.

Classes

struct  RDL_cycle
 

Typedefs

typedef struct RDL_data RDL_data
 Structure representing a calculation result. More...
 
typedef struct RDL_graph RDL_graph
 Datastructure representing a graph for calculations. More...
 
typedef unsigned RDL_node
 A node is represented by its index in the graph (0 to |V|-1).
 
typedef RDL_node RDL_edge[2]
 An edge is represented by an array of size two containing the adjacent nodes.
 
typedef enum RDL_ERROR_LEVEL RDL_ERROR_LEVEL
 error levels for custom logging functions
 
typedef void(* RDL_outputFunction) (RDL_ERROR_LEVEL level, const char *m,...)
 
typedef struct RDL_cycle RDL_cycle
 
typedef struct RDL_cycleIterator RDL_cycleIterator
 Iterator for relevant cycles. More...
 

Enumerations

enum  RDL_ERROR_LEVEL { RDL_DEBUG, RDL_WARNING, RDL_ERROR, RDL_INITIALIZE_OUTPUT }
 error levels for custom logging functions
 

Functions

RDL_API void RDL_setOutputFunction (RDL_outputFunction func)
 Set the output function for warning and error messages. More...
 
RDL_API void RDL_writeToStderr (RDL_ERROR_LEVEL level, const char *fmt,...)
 An output function for writing everything to stderr.
 
RDL_API void RDL_writeNothing (RDL_ERROR_LEVEL level, const char *fmt,...)
 No output function.
 
RDL_API RDL_graphRDL_initNewGraph (unsigned nof_nodes)
 Initializes a new RDL_graph. More...
 
RDL_API void RDL_deleteGraph (RDL_graph *graph)
 Delete RDL_graph. More...
 
RDL_API unsigned RDL_addUEdge (RDL_graph *graph, RDL_node node1, RDL_node node2)
 Adds an undirected edge to the graph. More...
 
RDL_API RDL_dataRDL_calculate (RDL_graph *input_graph)
 Calculates the RDL_data structure of the given graph and returns it. More...
 
RDL_API void RDL_deleteData (RDL_data *data)
 Deletes RDL_data from memory, including the RDL_graph. More...
 
RDL_API unsigned RDL_getNofURF (const RDL_data *data)
 Returns the number of URFs. More...
 
RDL_API unsigned RDL_getNofRCF (const RDL_data *data)
 Returns the number of RCFs. More...
 
RDL_API unsigned RDL_getWeightForURF (const RDL_data *data, unsigned index)
 Returns the weight of each cycle in the URF identified by its index. More...
 
RDL_API unsigned RDL_getWeightForRCF (const RDL_data *data, unsigned index)
 Returns the weight of each cycle in the RCF identified by its index. More...
 
RDL_API unsigned RDL_getNodesForURF (const RDL_data *data, unsigned index, RDL_node **RDL_node_array_ptr)
 Gives the nodes of an URF identified with its index in an array of RDL_node. More...
 
RDL_API unsigned RDL_getEdgesForURF (const RDL_data *data, unsigned index, RDL_edge **RDL_edge_array_ptr)
 Gives the edges of an URF identified with its index. More...
 
RDL_API unsigned RDL_getNodesForRCF (const RDL_data *data, unsigned index, RDL_node **RDL_node_array_ptr)
 Gives the nodes of an RCF identified with its index in an array of RDL_node. More...
 
RDL_API unsigned RDL_getEdgesForRCF (const RDL_data *data, unsigned index, RDL_edge **RDL_edge_array_ptr)
 Gives the edges of an RCF identified with its index. More...
 
RDL_API unsigned RDL_getNofURFContainingNode (const RDL_data *data, RDL_node node)
 Returns the number of URFs that contain the given node. More...
 
RDL_API unsigned RDL_getNofURFContainingEdge (const RDL_data *data, RDL_node node1, RDL_node node2)
 Returns the number of URFs that contain the RDL_edge defined by the two given nodes. More...
 
RDL_API unsigned RDL_getNofRCFContainingNode (const RDL_data *data, RDL_node node)
 Returns the number of RCFs that contain the given node. More...
 
RDL_API unsigned RDL_getNofRCFContainingEdge (const RDL_data *data, RDL_node node1, RDL_node node2)
 Returns the number of RCFs that contain the RDL_edge defined by the two given nodes. More...
 
RDL_API unsigned RDL_getURFsContainingNode (const RDL_data *data, RDL_node node, unsigned **RDL_ids_ptr)
 Gives all URFs containing the node. More...
 
RDL_API unsigned RDL_getURFsContainingEdge (const RDL_data *data, RDL_node node1, RDL_node node2, unsigned **RDL_ids_ptr)
 Gives all URFs containing the edge. More...
 
RDL_API unsigned RDL_getRCFsContainingNode (const RDL_data *data, RDL_node node, unsigned **RDL_ids_ptr)
 Gives all RCFs containing the node. More...
 
RDL_API unsigned RDL_getRCFsContainingEdge (const RDL_data *data, RDL_node node1, RDL_node node2, unsigned **RDL_ids_ptr)
 Gives all RCFs containing the edge. More...
 
RDL_API void RDL_deleteCycle (RDL_cycle *cycle)
 Free memory of RDL_cycle. More...
 
RDL_API RDL_cycleIteratorRDL_cycleIteratorNext (RDL_cycleIterator *it)
 Advance the cycle iterator by one. More...
 
RDL_API RDL_cycleRDL_cycleIteratorGetCycle (RDL_cycleIterator *it)
 Get the cycle as RDL_cycle. More...
 
RDL_API int RDL_cycleIteratorAtEnd (RDL_cycleIterator *it)
 Check if iterator is at end (invalid) More...
 
RDL_API void RDL_deleteCycleIterator (RDL_cycleIterator *it)
 Free memory of the cycle iterator. More...
 
RDL_API unsigned RDL_getRCyclesForURF (const RDL_data *data, unsigned index, RDL_cycle ***RDL_cycle_array_ptr)
 Gives all relevant cycles of the URF with the given index. More...
 
RDL_API RDL_cycleIteratorRDL_getRCyclesForURFIterator (const RDL_data *data, unsigned index)
 Get iterator for all relevant cycles of the URF with the given index. More...
 
RDL_API unsigned RDL_getRCyclesForRCF (const RDL_data *data, unsigned index, RDL_cycle ***RDL_cycle_array_ptr)
 Gives all relevant cycles of the RCF with the given index. More...
 
RDL_API RDL_cycleIteratorRDL_getRCyclesForRCFIterator (const RDL_data *data, unsigned index)
 Get iterator for all relevant cycles of the RCF with the given index. More...
 
RDL_API unsigned RDL_getRCycles (const RDL_data *data, RDL_cycle ***RDL_cycle_array_ptr)
 Gives a list of all relevant cycles. More...
 
RDL_API RDL_cycleIteratorRDL_getRCyclesIterator (const RDL_data *data)
 Get iterator for all relevant cycles. More...
 
RDL_API double RDL_getNofRCForURF (const RDL_data *data, unsigned index)
 Gives the number of relevant cycles in this URF. More...
 
RDL_API double RDL_getNofRCForRCF (const RDL_data *data, unsigned index)
 Gives the number of relevant cycles in this RCF. More...
 
RDL_API double RDL_getNofRC (const RDL_data *data)
 Gives the number of relevant cycles. More...
 
RDL_API unsigned RDL_getSSSR (const RDL_data *data, RDL_cycle ***RDL_cycle_array_ptr)
 Gives a set of cycles that forms a Minimal Cycle Basis of the graph. More...
 
RDL_API unsigned RDL_getRCPrototypes (const RDL_data *data, RDL_cycle ***RDL_cycle_array_ptr)
 Gives a list of relevant cycle prototypes (one for each RCF). More...
 
RDL_API void RDL_deleteCycles (RDL_cycle **cycles, unsigned number)
 Deallocates the structure given by RDL_getRCycles(), RDL_getSSSR(), RDL_getRCPrototypes() and RDL_getRCyclesForURF(), if called on its result and return value (the number of cycles) More...
 
RDL_API unsigned RDL_translateCycArray (const RDL_data *data, RDL_cycle **old_array, unsigned number, char ***RDL_cycle_array_ptr)
 Translates the results of RDL_getRCycles(), RDL_getSSSR(), RDL_getRCPrototypes() and RDL_getRCyclesForURF() (arrays of RDL_cycle) into an array of cycles represented by arrays of {0,1}^|E| (bitsets). More...
 
RDL_API void RDL_deleteEdgeIdxArray (char **cycles, unsigned number)
 Deallocates the structure given by RDL_translateCycArray(), if called on its result and return value (the number of cycles). More...
 
RDL_API unsigned RDL_getEdgeArray (const RDL_data *data, RDL_edge **RDL_edge_array_ptr)
 Gives the edges of the graph. More...
 
RDL_API unsigned RDL_getNofEdges (const RDL_data *data)
 Get the number of edges in the graph. More...
 
RDL_API unsigned RDL_getEdgeId (const RDL_data *data, unsigned from, unsigned to)
 Get the id of the edge. More...
 
RDL_API unsigned RDL_getNofRingsystems (const RDL_data *data)
 Get the number of ring systems in the graph. More...
 
RDL_API unsigned RDL_getNofNodesForRingsystem (const RDL_data *data, unsigned idx)
 Get the number of nodes in the ring system. More...
 
RDL_API unsigned RDL_getNofEdgesForRingsystem (const RDL_data *data, unsigned idx)
 Get the number of edges in the ring system. More...
 
RDL_API unsigned RDL_getEdgesForRingsystem (const RDL_data *data, unsigned idx, RDL_edge **edges)
 Get the edges in the ring system. More...
 
RDL_API unsigned RDL_getNodesForRingsystem (const RDL_data *data, unsigned idx, RDL_node **nodes)
 Get the nodes in the ring system. More...
 
RDL_API unsigned RDL_getRingsystemForEdge (const RDL_data *data, unsigned from, unsigned to)
 Get the ring system id for given edge. More...
 

Variables

RDL_API RDL_outputFunction RDL_outputFunc
 the output function for warnings and errors
 
RDL_API const unsigned RDL_INVALID_RESULT
 Invalid result indicator.
 
RDL_API const unsigned RDL_DUPLICATE_EDGE
 Duplicate edge indicator.
 
RDL_API const unsigned RDL_NO_RINGSYSTEM
 No ringsystem indicator.
 
RDL_API const double RDL_INVALID_RC_COUNT
 Invalid number of RCs.
 

Detailed Description

This file contains the API of the RingDecomposerLib library.

Typedef Documentation

◆ RDL_cycle

typedef struct RDL_cycle RDL_cycle

This structure holds a cycle (or ring) in the graph. It is essentially an array of edges which are represented by pairs of nodes.

◆ RDL_cycleIterator

Iterator for relevant cycles.

Always check if the iterator is at end BEFORE incrementing or accessing it.

Example usage:

RDL_cycle *cycle;
RDL_cycleIterator *it = RDL_getRCyclesIterator(data);
while(!RDL_cycleIteratorAtEnd(it)) {
  cycle = RDL_cycleIteratorGetCycle(it);
  <do something with the cycle>
  RDL_deleteCycle(cycle);
  RDL_cycleIteratorNext(it);
}
RDL_deleteCycleIterator(it);

◆ RDL_data

typedef struct RDL_data RDL_data

Structure representing a calculation result.

This is the central structure, that is used to store the calculation results. Almost all functions in this header work on it.

◆ RDL_graph

typedef struct RDL_graph RDL_graph

Datastructure representing a graph for calculations.

Build graph data structure that is used for the calculation. The graph is stored as an adjacency list. The vertices are numbered from 0 to |V|-1. Call the following functions:

RDL_initNewGraph(unsigned V) to initialize a new graph with V vertices (returns RDL_graph *)

RDL_addUEdge(RDL_graph *, RDL_node from, RDL_node to) to add a new (undirected) edge from the vertex with index "from" to the vertex with index "to".

Then RDL_calculate can be called on it.

Function Documentation

◆ RDL_addUEdge()

RDL_API unsigned RDL_addUEdge ( RDL_graph graph,
RDL_node  node1,
RDL_node  node2 
)

Adds an undirected edge to the graph.

Parameters
graphpointer to the RDL_graph that the edge will to be added to
node1,node2pair of RDL_node which the edge is going to connect
Returns
internal index of edge if successful, RDL_INVALID_RESULT on failures (invalid index, loop), RDL_DUPLICATE_EDGE if the edge was already present

◆ RDL_calculate()

RDL_API RDL_data* RDL_calculate ( RDL_graph input_graph)

Calculates the RDL_data structure of the given graph and returns it.

Parameters
input_graphThe graph for calculation.
Returns
pointer to the RDL_data containing the calculation result, NULL on failure
Note
The RDL_graph has to be an undirected graph.
Takes ownership of the RDL_graph, if calculation is successful!

◆ RDL_cycleIteratorAtEnd()

RDL_API int RDL_cycleIteratorAtEnd ( RDL_cycleIterator it)

Check if iterator is at end (invalid)

Parameters
itRDL_cycleIterator
Returns
0 if not at end, a non-zero value otherwise

◆ RDL_cycleIteratorGetCycle()

RDL_API RDL_cycle* RDL_cycleIteratorGetCycle ( RDL_cycleIterator it)

Get the cycle as RDL_cycle.

Parameters
itRDL_cycleIterator
Returns
RDL_cycle holding the cycle, NULL on error
Note
The RDL_cycle is constructed and returned as a pointer. You have to delete it using RDL_deleteCycle.
DO NOT call without checking RDL_cycleIteratorAtEnd

◆ RDL_cycleIteratorNext()

RDL_API RDL_cycleIterator* RDL_cycleIteratorNext ( RDL_cycleIterator it)

Advance the cycle iterator by one.

Parameters
itRDL_cycleIterator
Returns
returns the iterator it itself, if successful; NULL on error
Note
DO NOT call without checking RDL_cycleIteratorAtEnd

◆ RDL_deleteCycle()

RDL_API void RDL_deleteCycle ( RDL_cycle cycle)

Free memory of RDL_cycle.

Parameters
cycleThe RDL_cycle to delete.

◆ RDL_deleteCycleIterator()

RDL_API void RDL_deleteCycleIterator ( RDL_cycleIterator it)

Free memory of the cycle iterator.

Parameters
itRDL_cycleIterator

◆ RDL_deleteCycles()

RDL_API void RDL_deleteCycles ( RDL_cycle **  cycles,
unsigned  number 
)

Deallocates the structure given by RDL_getRCycles(), RDL_getSSSR(), RDL_getRCPrototypes() and RDL_getRCyclesForURF(), if called on its result and return value (the number of cycles)

Parameters
cyclesThe array of cycles.
numberThe number of cycles in the array

◆ RDL_deleteData()

RDL_API void RDL_deleteData ( RDL_data data)

Deletes RDL_data from memory, including the RDL_graph.

Parameters
datapointer to the RDL_data that is going to be deleted
Note
also deletes the associated RDL_graph

◆ RDL_deleteEdgeIdxArray()

RDL_API void RDL_deleteEdgeIdxArray ( char **  cycles,
unsigned  number 
)

Deallocates the structure given by RDL_translateCycArray(), if called on its result and return value (the number of cycles).

Parameters
cyclesThe translated array of cycles.
numberThe number of cycles in the array.

◆ RDL_deleteGraph()

RDL_API void RDL_deleteGraph ( RDL_graph graph)

Delete RDL_graph.

Parameters
graphpointer to RDL_graph to delete
Note
You don't have to delete the graph after successful calculation!

◆ RDL_getEdgeArray()

RDL_API unsigned RDL_getEdgeArray ( const RDL_data data,
RDL_edge **  RDL_edge_array_ptr 
)

Gives the edges of the graph.

Returns
the number of edges in the graph, RDL_INVALID_RESULT on error
Parameters
datapointer to the RDL_data holding the calculation results.
RDL_edge_array_ptrpointer that points to the result array (declare RDL_edge * and give address as parameter)
Note
Result has to be deallocated using free(*RDL_edge_array_ptr)

◆ RDL_getEdgeId()

RDL_API unsigned RDL_getEdgeId ( const RDL_data data,
unsigned  from,
unsigned  to 
)

Get the id of the edge.

Parameters
datapointer to the RDL_data holding the calculation results.
fromRDL_node starting at this edge
toRDL_node starting at this edge
Returns
edge id, RDL_INVALID_RESULT, if not present
Note
As the graph is stored as an adjacency list, this function has linear runtime in the node degree.

◆ RDL_getEdgesForRCF()

RDL_API unsigned RDL_getEdgesForRCF ( const RDL_data data,
unsigned  index,
RDL_edge **  RDL_edge_array_ptr 
)

Gives the edges of an RCF identified with its index.

Returns
the number of edges in this RCF, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results.
indexthe index of the RCF
RDL_edge_array_ptrpointer that points to the result array (declare RDL_edge * and give address as parameter)
Note
Result has to be deallocated using free(*RDL_edge_array_ptr) Gives an array of edges where an edge is represented by two RDL_node that it connects.

◆ RDL_getEdgesForRingsystem()

RDL_API unsigned RDL_getEdgesForRingsystem ( const RDL_data data,
unsigned  idx,
RDL_edge **  edges 
)

Get the edges in the ring system.

Parameters
datapointer to the RDL_data holding the calculation results.
idxindex of the ring system
edgespointer that points to the result array (declare RDL_edge * and give address as parameter)
Note
Result has to be deallocated using free(*edges)
Returns
number of edges in the ring system, RDL_INVALID_RESULT on error
Note
A ring system is a 2-connected component of the graph.

◆ RDL_getEdgesForURF()

RDL_API unsigned RDL_getEdgesForURF ( const RDL_data data,
unsigned  index,
RDL_edge **  RDL_edge_array_ptr 
)

Gives the edges of an URF identified with its index.

Returns
the number of edges in this URF, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results.
indexthe index of the URF
RDL_edge_array_ptrpointer that points to the result array (declare RDL_edge * and give address as parameter)
Note
Result has to be deallocated using free(*RDL_edge_array_ptr) Gives an array of edges where an edge is represented by two RDL_node that it connects.

◆ RDL_getNodesForRCF()

RDL_API unsigned RDL_getNodesForRCF ( const RDL_data data,
unsigned  index,
RDL_node **  RDL_node_array_ptr 
)

Gives the nodes of an RCF identified with its index in an array of RDL_node.

Returns
the number of nodes in the RCF, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results.
indexthe index of the RCF
RDL_node_array_ptrpointer that points to the result array (declare RDL_node * and give address as parameter)
Note
result has to be deallocated using free(*RDL_node_array_ptr).

◆ RDL_getNodesForRingsystem()

RDL_API unsigned RDL_getNodesForRingsystem ( const RDL_data data,
unsigned  idx,
RDL_node **  nodes 
)

Get the nodes in the ring system.

Parameters
datapointer to the RDL_data holding the calculation results.
idxindex of the ring system
nodespointer that points to the result array (declare RDL_edge * and give address as parameter)
Note
Result has to be deallocated using free(*nodes)
Returns
number of nodes in the ring system, RDL_INVALID_RESULT on error
Note
A ring system is a 2-connected component of the graph.

◆ RDL_getNodesForURF()

RDL_API unsigned RDL_getNodesForURF ( const RDL_data data,
unsigned  index,
RDL_node **  RDL_node_array_ptr 
)

Gives the nodes of an URF identified with its index in an array of RDL_node.

Returns
the number of nodes in the URF, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results.
indexthe index of the URF
RDL_node_array_ptrpointer that points to the result array (declare RDL_node * and give address as parameter)
Note
result has to be deallocated using free(*RDL_node_array_ptr).

◆ RDL_getNofEdges()

RDL_API unsigned RDL_getNofEdges ( const RDL_data data)

Get the number of edges in the graph.

Parameters
datapointer to the RDL_data holding the calculation results.
Returns
number of edges in the graph, RDL_INVALID_RESULT on error

◆ RDL_getNofEdgesForRingsystem()

RDL_API unsigned RDL_getNofEdgesForRingsystem ( const RDL_data data,
unsigned  idx 
)

Get the number of edges in the ring system.

Parameters
datapointer to the RDL_data holding the calculation results.
idxindex of the ring system
Returns
number of edges in the ring system, RDL_INVALID_RESULT on error
Note
A ring system is a 2-connected component of the graph.

◆ RDL_getNofNodesForRingsystem()

RDL_API unsigned RDL_getNofNodesForRingsystem ( const RDL_data data,
unsigned  idx 
)

Get the number of nodes in the ring system.

Parameters
datapointer to the RDL_data holding the calculation results.
idxindex of the ring system
Returns
number of nodes in the ring system, RDL_INVALID_RESULT on error
Note
A ring system is a 2-connected component of the graph.

◆ RDL_getNofRC()

RDL_API double RDL_getNofRC ( const RDL_data data)

Gives the number of relevant cycles.

Parameters
datapointer to the RDL_data holding the calculation results
Returns
the number of relevant cycles RDL_INVALID_RC_COUNT if the number is too large to calculate or on failure

◆ RDL_getNofRCF()

RDL_API unsigned RDL_getNofRCF ( const RDL_data data)

Returns the number of RCFs.

Parameters
dataPointer to the RDL_data of which the number of RCF is requested
Returns
The number of RCFs, RDL_INVALID_RESULT on failure

◆ RDL_getNofRCFContainingEdge()

RDL_API unsigned RDL_getNofRCFContainingEdge ( const RDL_data data,
RDL_node  node1,
RDL_node  node2 
)

Returns the number of RCFs that contain the RDL_edge defined by the two given nodes.

Parameters
dataPointer to the RDL_data storing the calculation results.
node1,node2pair of RDL_node connected by the edge
Returns
number of RCFs containing the edge, RDL_INVALID_RESULT on failure
Note
This functions internally enumerates all edges for each RCF. For repeated checks with different RDL_node it is recommended to enumerate them with RDL_getEdgesForRCF and check against this array.

◆ RDL_getNofRCFContainingNode()

RDL_API unsigned RDL_getNofRCFContainingNode ( const RDL_data data,
RDL_node  node 
)

Returns the number of RCFs that contain the given node.

Parameters
datapointer to the RDL_data holding the calculation results.
nodethe RDL_node to look for in the RCFs
Returns
number of RCFs containing the node, RDL_INVALID_RESULT on failure
Note
This functions internally enumerates all nodes for each RCF. For repeated checks with different RDL_node it is recommended to enumerate them with RDL_getNodesForRCF and check against this array.

◆ RDL_getNofRCForRCF()

RDL_API double RDL_getNofRCForRCF ( const RDL_data data,
unsigned  index 
)

Gives the number of relevant cycles in this RCF.

Parameters
datapointer to the RDL_data holding the calculation results.
indexid of the RCF
Returns
the number of relevant cycles in the RCF or RDL_INVALID_RC_COUNT if the number is too large to calculate or on failure

◆ RDL_getNofRCForURF()

RDL_API double RDL_getNofRCForURF ( const RDL_data data,
unsigned  index 
)

Gives the number of relevant cycles in this URF.

Parameters
datapointer to the RDL_data holding the calculation results
indexthe index of the URF
Returns
the number of relevant cycles in the URF or RDL_INVALID_RC_COUNT if the number is too large to calculate or on failure

◆ RDL_getNofRingsystems()

RDL_API unsigned RDL_getNofRingsystems ( const RDL_data data)

Get the number of ring systems in the graph.

Parameters
datapointer to the RDL_data holding the calculation results.
Returns
number of ring systems in the graph, RDL_INVALID_RESULT on error

◆ RDL_getNofURF()

RDL_API unsigned RDL_getNofURF ( const RDL_data data)

Returns the number of URFs.

Parameters
dataPointer to the RDL_data of which the number of URF is requested
Returns
The number of URFs, RDL_INVALID_RESULT on failure

◆ RDL_getNofURFContainingEdge()

RDL_API unsigned RDL_getNofURFContainingEdge ( const RDL_data data,
RDL_node  node1,
RDL_node  node2 
)

Returns the number of URFs that contain the RDL_edge defined by the two given nodes.

Parameters
dataPointer to the RDL_data storing the calculation results.
node1,node2pair of RDL_node connected by the edge
Returns
number of URFs containing the edge, RDL_INVALID_RESULT on failure
Note
This functions internally enumerates all edges for each URF. For repeated checks with different RDL_node it is recommended to enumerate them with RDL_getEdgesForURF and check against this array.

◆ RDL_getNofURFContainingNode()

RDL_API unsigned RDL_getNofURFContainingNode ( const RDL_data data,
RDL_node  node 
)

Returns the number of URFs that contain the given node.

Parameters
datapointer to the RDL_data holding the calculation results.
nodethe RDL_node to look for in the URFs
Returns
number of URFs containing the node, RDL_INVALID_RESULT on failure
Note
This functions internally enumerates all nodes for each URF. For repeated checks with different RDL_node it is recommended to enumerate them with RDL_getNodesForURF and check against this array.

◆ RDL_getRCFsContainingEdge()

RDL_API unsigned RDL_getRCFsContainingEdge ( const RDL_data data,
RDL_node  node1,
RDL_node  node2,
unsigned **  RDL_ids_ptr 
)

Gives all RCFs containing the edge.

Returns
the number of RCFs containing the edge, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results
node1the first RDL_node of the edge
node2the the second RDL_node of the edge
RDL_ids_ptrpointer that points to the result array of integers containing all indices of RCFs containing the edge. (declare unsigned * and give address as parameter)
Note
The array RDL_ids_ptr has to be to be deallocated with free(*RDL_ids_ptr)
This functions internally enumerates all edges for each RCF. For repeated queries with different RDL_node it is recommended to enumerate them with RDL_getEdgesForRCF once and use this array.

◆ RDL_getRCFsContainingNode()

RDL_API unsigned RDL_getRCFsContainingNode ( const RDL_data data,
RDL_node  node,
unsigned **  RDL_ids_ptr 
)

Gives all RCFs containing the node.

Returns
the number of RCFs containing the node, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results
nodethe RDL_node
RDL_ids_ptrpointer that points to the result array of integers containing all indices of URFs containing the node. (declare unsigned * and give address as parameter)
Note
The array RDL_ids_ptr has to be to be deallocated with free(*RDL_ids_ptr)
This functions internally enumerates all nodes for each RCF. For repeated queries with different RDL_node it is recommended to enumerate them with RDL_getNodesForRCF once and use this array.

◆ RDL_getRCPrototypes()

RDL_API unsigned RDL_getRCPrototypes ( const RDL_data data,
RDL_cycle ***  RDL_cycle_array_ptr 
)

Gives a list of relevant cycle prototypes (one for each RCF).

Returns
the number of prototypes, RDL_INVALID_RESULT on error
Parameters
datapointer to the RDL_data holding the calculation results
RDL_cycle_array_ptrpointer to the result array (declare RDL_cycle ** and give address as parameter) The result is an array of cycles.
Note
Result has to be deallocated using RDL_deleteCycles(RDL_cycle **cycles, unsigned number)

◆ RDL_getRCycles()

RDL_API unsigned RDL_getRCycles ( const RDL_data data,
RDL_cycle ***  RDL_cycle_array_ptr 
)

Gives a list of all relevant cycles.

Returns
the number of cycles, RDL_INVALID_RESULT on error
Parameters
datapointer to the RDL_data holding the calculation results
RDL_cycle_array_ptrpointer to the result array (declare RDL_cycle ** and give address as parameter) The result is an array of cycles.
Note
Result has to be deallocated using RDL_deleteCycles(RDL_cycle **cycles, unsigned number)
Consider using RDL_getRCyclesIterator instead

◆ RDL_getRCyclesForRCF()

RDL_API unsigned RDL_getRCyclesForRCF ( const RDL_data data,
unsigned  index,
RDL_cycle ***  RDL_cycle_array_ptr 
)

Gives all relevant cycles of the RCF with the given index.

Returns
the number of cycles found, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results
indexthe index of the RCF
RDL_cycle_array_ptrpointer that points to the result array of cycles (declare RDL_cycle ** and give address as parameter)
Note
RDL_cycle_array_ptr has to be deallocated using RDL_deleteCycles(RDL_cycle **cycles, unsigned number)
Consider using RDL_getRCyclesForRCFIterator instead

◆ RDL_getRCyclesForRCFIterator()

RDL_API RDL_cycleIterator* RDL_getRCyclesForRCFIterator ( const RDL_data data,
unsigned  index 
)

Get iterator for all relevant cycles of the RCF with the given index.

Returns
RDL_cycleIterator, NULL on failure
Parameters
datapointer to the RDL_data holding the calculation results
indexthe index of the RCF
Note
See RDL_cycleIterator for an example.

◆ RDL_getRCyclesForURF()

RDL_API unsigned RDL_getRCyclesForURF ( const RDL_data data,
unsigned  index,
RDL_cycle ***  RDL_cycle_array_ptr 
)

Gives all relevant cycles of the URF with the given index.

Returns
the number of cycles found, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results
indexthe index of the URF
RDL_cycle_array_ptrpointer that points to the result array of cycles (declare RDL_cycle ** and give address as parameter)
Note
RDL_cycle_array_ptr has to be deallocated using RDL_deleteCycles(RDL_cycle **cycles, unsigned number)
Consider using RDL_getRCyclesForURFIterator instead

◆ RDL_getRCyclesForURFIterator()

RDL_API RDL_cycleIterator* RDL_getRCyclesForURFIterator ( const RDL_data data,
unsigned  index 
)

Get iterator for all relevant cycles of the URF with the given index.

Returns
RDL_cycleIterator, NULL on failure
Parameters
datapointer to the RDL_data holding the calculation results
indexthe index of the URF
Note
See RDL_cycleIterator for an example.

◆ RDL_getRCyclesIterator()

RDL_API RDL_cycleIterator* RDL_getRCyclesIterator ( const RDL_data data)

Get iterator for all relevant cycles.

Returns
RDL_cycleIterator, NULL on failure
Parameters
datapointer to the RDL_data holding the calculation results
Note
See RDL_cycleIterator for an example.

◆ RDL_getRingsystemForEdge()

RDL_API unsigned RDL_getRingsystemForEdge ( const RDL_data data,
unsigned  from,
unsigned  to 
)

Get the ring system id for given edge.

Parameters
datapointer to the RDL_data holding the calculation results.
fromRDL_node starting at this edge
toRDL_node starting at this edge
Returns
number of edges in the ring system, RDL_INVALID_RESULT on error RDL_NO_RINGSYSTEM if edge is not part of a ring system
Note
A ring system is a 2-connected component of the graph.

◆ RDL_getSSSR()

RDL_API unsigned RDL_getSSSR ( const RDL_data data,
RDL_cycle ***  RDL_cycle_array_ptr 
)

Gives a set of cycles that forms a Minimal Cycle Basis of the graph.

Returns
the number of cycles returned (|E|-|V|+1 for connected graphs), RDL_INVALID_RESULT on error
Parameters
datapointer to the RDL_data holding the calculation results
RDL_cycle_array_ptrpointer that points to the result array (declare RDL_cycle ** and give address as parameter)
Note
Result has to be deallocated using RDL_deleteCycles(RDL_cycle **cycles, unsigned number) The result is an array of cycles.

◆ RDL_getURFsContainingEdge()

RDL_API unsigned RDL_getURFsContainingEdge ( const RDL_data data,
RDL_node  node1,
RDL_node  node2,
unsigned **  RDL_ids_ptr 
)

Gives all URFs containing the edge.

Returns
the number of URFs containing the edge, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results
node1the first RDL_node of the edge
node2the the second RDL_node of the edge
RDL_ids_ptrpointer that points to the result array of integers containing all indices of URFs containing the edge. (declare unsigned * and give address as parameter)
Note
The array RDL_ids_ptr has to be to be deallocated with free(*RDL_ids_ptr)
This functions internally enumerates all edges for each URF. For repeated queries with different RDL_node it is recommended to enumerate them with RDL_getEdgesForURF once and use this array.

◆ RDL_getURFsContainingNode()

RDL_API unsigned RDL_getURFsContainingNode ( const RDL_data data,
RDL_node  node,
unsigned **  RDL_ids_ptr 
)

Gives all URFs containing the node.

Returns
the number of URFs containing the node, RDL_INVALID_RESULT on failure
Parameters
datapointer to the RDL_data holding the calculation results
nodethe RDL_node
RDL_ids_ptrpointer that points to the result array of integers containing all indices of URFs containing the node. (declare unsigned * and give address as parameter)
Note
The array RDL_ids_ptr has to be to be deallocated with free(*RDL_ids_ptr)
This functions internally enumerates all nodes for each URF. For repeated queries with different RDL_node it is recommended to enumerate them with RDL_getNodesForURF once and use this array.

◆ RDL_getWeightForRCF()

RDL_API unsigned RDL_getWeightForRCF ( const RDL_data data,
unsigned  index 
)

Returns the weight of each cycle in the RCF identified by its index.

Parameters
datapointer to the RDL_data holding the URFs
indexthe index of the RCF
Returns
the weight of the RCF, RDL_INVALID_RESULT on failure (if index is out of range)

◆ RDL_getWeightForURF()

RDL_API unsigned RDL_getWeightForURF ( const RDL_data data,
unsigned  index 
)

Returns the weight of each cycle in the URF identified by its index.

Parameters
datapointer to the RDL_data holding the URFs
indexthe index of the URF
Returns
the weight of the URF, RDL_INVALID_RESULT on failure (if index is out of range)

◆ RDL_initNewGraph()

RDL_API RDL_graph* RDL_initNewGraph ( unsigned  nof_nodes)

Initializes a new RDL_graph.

Parameters
nof_nodesthe number of nodes in the graph
Returns
pointer to the new RDL_graph structure.

◆ RDL_setOutputFunction()

RDL_API void RDL_setOutputFunction ( RDL_outputFunction  func)

Set the output function for warning and error messages.

Parameters
funccallback function for errors and warnings
Warning
This function sets a static variable. When using multiple threads, only one thread should set the output function and the output function should be thread-safe.

Default is no output at all (RDL_writeNothing). Call RDL_setOutputFunction(RDL_writeToStderr) to enable output of warning and error messages to stderr.

◆ RDL_translateCycArray()

RDL_API unsigned RDL_translateCycArray ( const RDL_data data,
RDL_cycle **  old_array,
unsigned  number,
char ***  RDL_cycle_array_ptr 
)

Translates the results of RDL_getRCycles(), RDL_getSSSR(), RDL_getRCPrototypes() and RDL_getRCyclesForURF() (arrays of RDL_cycle) into an array of cycles represented by arrays of {0,1}^|E| (bitsets).

Parameters
datapointer to the RDL_data holding the calculation results.
old_arrayThe resulting structure of the functions named above
numberThe return value of the functions named above (the number of cycles given)
RDL_cycle_array_ptrpointer to the result array (declare char ** and give address as parameter)
Returns
The number of cycles given (same as the parameter 'number'), RDL_INVALID_RESULT on failure
Note
The initial structure still exists afterwards and still has to be deleted.

The resulting array has a 1 at position i if edge i is part of the cycle or 0 otherwise. An edge is identified by the position at which it was added to the graph starting at 0 (the return value of RDL_addUEdge()).