LibCapy - graph

Graph class.

Macros:

Enumerations:

None.

Typedefs:

None.

Struct CapyGraphNode :

Struct CapyGraphNode's properties:

ID of the node

Page rank value (default: 0.0, updated by CapyGraph.pageRank)

User's data

Struct CapyGraphNode's methods:

Destructor

Pointer to the two nodes of the link

None.

Struct CapyGraph :

Struct CapyGraph's properties:

List of nodes

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):

Exception(s):

May return CapyExc_MallocFailed

Input argument(s):

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 raise CapyExc_InvalidNodeIdx 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

Run the PageRank algorithm to evaluate nodes in the graph

Input argument(s):

nbIter: number of iteration of the algorithm

Output and side effect(s):

The pageRank properties of nodes is updated

Functions:

Create a CapyGraphNode

Input argument(s):

id: id of the node in the graph

Output and side effect(s):

Return the node.

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,
40 views