#include <mmn_graph_rep1.h>
Optimised for adding arcs and finding arcs for each node. Assumes that there is an ordered list of arcs (but doesn't actually record it explicitly).
Definition at line 17 of file mmn_graph_rep1.h.
Public Member Functions | |
| mmn_graph_rep1 () | |
| Default constructor. | |
| const vcl_vector< vcl_vector< vcl_pair< unsigned, unsigned > > > & | node_data () const |
| Indicates arcs connected to each node. | |
| unsigned | max_n_arcs () const |
| Maximum number of distinct arcs used. | |
| unsigned | n_arcs () const |
| Current number of arcs. | |
| void | build (unsigned n_nodes, const vcl_vector< mmn_arc > &arcs) |
| Build from list of arcs. | |
| int | arc_index (unsigned v1, unsigned v2) const |
| Return index of arc between v1 and v2, or -1 if none. | |
| unsigned | get_arc (unsigned v1, unsigned v2) |
| Return index of arc between v1 and v2, creating one if none exists. | |
| unsigned | remove_leaves (vcl_vector< mmn_dependancy > &deps) |
| Remove some of leaves of graph, recording dependencies. | |
| unsigned | remove_all_leaves (vcl_vector< mmn_dependancy > &deps) |
| Remove all of leaves of graph, recording dependencies. | |
| unsigned | remove_pair_deps (vcl_vector< mmn_dependancy > &deps) |
| Remove arcs from some of the nodes with two neighbours. | |
| bool | compute_dependancies (vcl_vector< mmn_dependancy > &deps) |
| Compute list of all single and pairwise dependencies. | |
Private Member Functions | |
| void | remove_arc_from_node (unsigned v1, unsigned v2) |
| Remove record of arc v1-v2 from v1. | |
Private Attributes | |
| vcl_vector< vcl_vector< vcl_pair< unsigned, unsigned > > > | node_data_ |
| Indicates arcs connected to each node. | |
| unsigned | max_n_arcs_ |
| Maximum number of arcs used. | |
| unsigned | n_arcs_ |
| Current number of arcs. | |
|
|
Default constructor.
Definition at line 9 of file mmn_graph_rep1.cxx. |
|
||||||||||||
|
Return index of arc between v1 and v2, or -1 if none.
Definition at line 32 of file mmn_graph_rep1.cxx. |
|
||||||||||||
|
Build from list of arcs.
Definition at line 15 of file mmn_graph_rep1.cxx. |
|
|
Compute list of all single and pairwise dependencies. Finds ordered list of dependencies. If returns true, then dep is an ordered list of dependencies allowing us solve a minimisation problem one node at a time. If it returns false, then the graph cannot be decomposed into a sequence of single or pairwise dependencies. If dep[i].n_dep==1 for all i, then the graph is a tree, and reversing the order of dep gives a means of traversing from the root to the leaves. The original order gives a method of visiting every node only after any child/leaf nodes have been visited first. Destroys current structure in the process. Definition at line 171 of file mmn_graph_rep1.cxx. |
|
||||||||||||
|
Return index of arc between v1 and v2, creating one if none exists.
Definition at line 41 of file mmn_graph_rep1.cxx. |
|
|
Maximum number of distinct arcs used.
Definition at line 50 of file mmn_graph_rep1.h. |
|
|
Current number of arcs.
Definition at line 53 of file mmn_graph_rep1.h. |
|
|
Indicates arcs connected to each node. node_data_[i][j].first == vertex connected to node i . *.second == index of arc which does the connection. Definition at line 46 of file mmn_graph_rep1.h. |
|
|
Remove all of leaves of graph, recording dependencies. A leaf node is one with only one arc For each leaf node removed, add one dependency object to the deps list. On exit, this graph has no leaves. Returns number of leaves removed. Definition at line 115 of file mmn_graph_rep1.cxx. |
|
||||||||||||
|
Remove record of arc v1-v2 from v1.
Definition at line 64 of file mmn_graph_rep1.cxx. |
|
|
Remove some of leaves of graph, recording dependencies. A leaf node is one with only one arc For each leaf node removed, add one dependency object to the deps list. Returns number of leaves removed. Definition at line 82 of file mmn_graph_rep1.cxx. |
|
|
Remove arcs from some of the nodes with two neighbours. Record the pairwise dependencies. For each node removed, add one dependency object to the deps list. Returns number of removed. Definition at line 133 of file mmn_graph_rep1.cxx. |
|
|
Maximum number of arcs used.
Definition at line 32 of file mmn_graph_rep1.h. |
|
|
Current number of arcs.
Definition at line 35 of file mmn_graph_rep1.h. |
|
|
Indicates arcs connected to each node. node_data_[i][j].first == vertex connected to node i . *.second == index of arc which does the connection. Definition at line 23 of file mmn_graph_rep1.h. |
1.4.4