chain_struct - chained structure from adjacency lists of a graph
chain_struct computes the row vectors of the edge chained structure description of the graph g. It is also possible to give directly chain_struct the adjacency lists of the graph. This is more efficient if the adjacency lists are already available since chain_struct uses them to make computations.
The vectors fe, che, fn and chn describe the chained structure in the following way:
fe(i)) is the number of the first edge starting from node i
che(fe(i)) is the number of the second edge starting from node i, che(che(fe(i))) is the number of the third edge starting from node i and so on until the value is 0
fn(i) is the number of the first node reached from node i
ch(i) is the number of the node reached by edge che(i).
ta=[1 1 2 3 5 4 6 7 7 3 3 8 8 5]; he=[2 3 5 4 6 6 7 4 3 2 8 1 7 4]; g=make_graph('foo',1,8,ta,he); g('node_x')=[116 231 192 323 354 454 305 155]; g('node_y')=[118 116 212 219 117 185 334 316]; show_graph(g); [fe,che,fn,chn] = chain_struct(g)