LibCapy - graph

Graph class.

Macros:

Enumerations:

None.

Typedefs:

None.

Struct CapyGraphNode :

Struct CapyGraphNode's properties:

ID of the node

User's data

Struct CapyGraphNode's methods:

None.

Struct CapyGraphLink :

Struct CapyGraphLink's properties:

Pointer to the two nodes of the link

Struct CapyGraphLink's methods:

None.

Struct CapyGraph :

Struct CapyGraph's properties:

List of nodes

List of links

Flag to memorise if the graph is directed (default: false)

Connectivity matrix (updated with updateConnectivityMat()) connectivityMat[i*nbNode+j] is true if there is a link from i to j

Link distance matrix (updated with updateLinkDistanceMat()) linkDistanceMat[i*nbNode+j] is the smallest number of steps (in term of links) from i to j, 0 means there is no path from i to j

Struct CapyGraph's methods:

Destructor

Add a node to the graph.

Input argument(s):

node: the node to add

Exception(s):

May return CapyExc_MallocFailed

Add a link to the graph.

Input argument(s):

link: the link to add

Exception(s):

May return CapyExc_MallocFailed

Link two nodes in the graph given their id.

Input argument(s):

idA: ID of the first node
idB: ID of the second node

Exception(s):

May return CapyExc_MallocFailed, CapyExc_InvalidNodeIdx

Update the connectivity matrix of the graph

Exception(s):

May return CapyExc_MallocFailed, CapyExc_InvalidNodeIdx

Get the index of a node in the list of nodes of a graph

Input argument(s):

node: the node

Output and side effect(s):

Return the index of the node, or -1 if the nodes wasn't found

Update the link distance matrix of the graph based on the current connectivity matrix (update it with updateConnectivityMat if necessary before using this method)

Exception(s):

May return CapyExc_MallocFailed

Functions:

Create a CapyGraph

Output and side effect(s):

Return a CapyGraph

Allocate memory for a new CapyGraph and create it

Output and side effect(s):

Return a CapyGraph

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyGraph* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyGraph to free

2022-06-21
in LibCapy,
27 views
Copyright 2021-2023 Baillehache Pascal