Files | |
| file | eg_shrink_graph.c |
| file | eg_shrink_graph.ex.c |
| file | eg_shrink_graph.h |
Data Structures | |
| struct | EGsrkEdge_t |
| Edge structure for shrinkable graphs. More... | |
| struct | EGsrkGraph_t |
| Graph structure for shrinkable graphs. More... | |
| struct | EGsrkNode_t |
| Node structure for shrinkable graphs. More... | |
Defines | |
| #define | EG_SRK_DEBUG 100 |
| debuigging level, the lower the more debugging is carried out | |
| #define | EGsrkAddEdge(lG, head_pt, tail_pt, E) |
| Add a EGsrkEdge_t edge to a EGsrkGraph_t graph. | |
| #define | EGsrkAddNode(graph, N) EGeUgraphAddNode(&((graph)->G),&((N)->node)) |
| Add a EGsrkNode_t node to a EGsrkGraph_t graph. | |
| #define | EGsrkEdgeClear(e_edge) |
| Clear internal memory (not allocated by the user) of an edge structure. | |
| #define | EGsrkEdgeInit(e_edge) |
| Initialize an edge structure. | |
| #define | EGsrkGraphClear(graph) EGeUgraphClear(&((graph)->G)) |
| Clear internal memory (not allocated by the user) of a graph structure. | |
| #define | EGsrkGraphInit(graph) |
| Initialize a graph structure. | |
| #define | EGsrkNodeClear(e_node) |
| Clear internal memory (not allocated by the user) of a node structure. | |
| #define | EGsrkNodeInit(e_node) |
| Initialize a node structure. | |
Typedefs | |
| typedef EGsrkEdge_t | EGsrkEdge_t |
| Edge structure for shrinkable graphs. | |
| typedef EGsrkGraph_t | EGsrkGraph_t |
| Graph structure for shrinkable graphs. | |
| typedef EGsrkNode_t | EGsrkNode_t |
| Node structure for shrinkable graphs. | |
Functions | |
| static void | display_srkG (EGsrkGraph_t *G, EGsrkNode_t *const all_nodes, EGsrkEdge_t *const all_edges) |
| given a EGsrkGraph_t structure, display the current shrunken graph and it's node weights | |
| EGsrkNode_t * | EGsrkIdentifyNodes (EGsrkGraph_t *const G, EGsrkNode_t *const base, EGsrkNode_t *const srkN) |
| Given two nodes in the current shrunken graph, shrunk them into one node. | |
| int | main (int argc, char **argv) |
| This program read a graph a file from the input whose two first numbers are the number of nodes and edges (we assume that the graph is undirected ), and then a 3-tupla with head tail capacity. we use the last field (capacity) as the capacity of the edge. Once this graph has been read, we create a EGsrkGraph, and then we shrink the graph until two nodes remain. printing the graph at every iteration. | |
| static void | srk_usage (char **argv) |
| display usage of this program | |
|
|
debuigging level, the lower the more debugging is carried out
Definition at line 60 of file eg_shrink_graph.h. |
|
|
Value: ({\
EGsrkNode_t*const _EGsrkH = (head_pt);\
EGsrkNode_t*const _EGsrkT = (tail_pt);\
EGsrkEdge_t*const _EGsrkE = (E);\
EGlpNumAddTo(_EGsrkH->weight,_EGsrkE->weight);\
EGlpNumAddTo(_EGsrkT->weight,_EGsrkE->weight);\
EGeUgraphAddEdge(&((lG)->G),&(_EGsrkH->node),&(_EGsrkT->node),&(_EGsrkE->edge));})
Definition at line 180 of file eg_shrink_graph.h. |
|
|
Add a EGsrkNode_t node to a EGsrkGraph_t graph.
Definition at line 168 of file eg_shrink_graph.h. |
|
|
Value: ({\
EGeUgraphEdgeClear(&((e_edge)->edge));\
EGlpNumClearVar((e_edge)->weight);})
Definition at line 123 of file eg_shrink_graph.h. |
|
|
Value: ({\
EGsrkEdge_t*const _EGsrkE = (e_edge);\
EGeUgraphEdgeInit(&(_EGsrkE->edge));\
EGeListInit(&(_EGsrkE->members));\
_EGsrkE->mmb_sz = 0;\
EGlpNumInitVar(_EGsrkE->weight);\
EGlpNumZero(_EGsrkE->weight);})
Definition at line 111 of file eg_shrink_graph.h. |
|
|
Clear internal memory (not allocated by the user) of a graph structure.
Definition at line 139 of file eg_shrink_graph.h. |
|
|
Value: ({\
EGsrkGraph_t*const _EGsrkG = (graph);\
EGeUgraphInit(&(_EGsrkG->G));\
_EGsrkG->n_onodes = _EGsrkG->n_oedges = 0;})
Definition at line 130 of file eg_shrink_graph.h. |
|
|
Value: ({\
EGeUgraphNodeClear(&((e_node)->node));\
EGlpNumClearVar((e_node)->weight);})
Definition at line 158 of file eg_shrink_graph.h. |
|
|
Value: ({\
EGsrkNode_t*const _EGsrkN = (e_node);\
EGeUgraphNodeInit(&(_EGsrkN->node));\
EGeListInit(&(_EGsrkN->members));\
_EGsrkN->mmb_sz = 0;\
_EGsrkN->hit = 0;\
EGesInit(&(_EGsrkN->parent));\
EGlpNumInitVar(_EGsrkN->weight);\
EGlpNumZero(_EGsrkN->weight);})
Definition at line 144 of file eg_shrink_graph.h. |
|
|
Edge structure for shrinkable graphs.
|
|
|
Graph structure for shrinkable graphs.
|
|
|
Node structure for shrinkable graphs.
|
|
||||||||||||||||
|
given a EGsrkGraph_t structure, display the current shrunken graph and it's node weights
Definition at line 36 of file eg_shrink_graph.ex.c. |
|
||||||||||||||||
|
Given two nodes in the current shrunken graph, shrunk them into one node.
Definition at line 28 of file eg_shrink_graph.c. |
|
||||||||||||
|
This program read a graph a file from the input whose two first numbers are the number of nodes and edges (we assume that the graph is undirected ), and then a 3-tupla with head tail capacity. we use the last field (capacity) as the capacity of the edge. Once this graph has been read, we create a EGsrkGraph, and then we shrink the graph until two nodes remain. printing the graph at every iteration.
Definition at line 107 of file eg_shrink_graph.ex.c. Here is the call graph for this function: ![]() |
|
|
display usage of this program
Definition at line 28 of file eg_shrink_graph.ex.c. |
1.4.5