A= 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0
1 0 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 0
1 1 0 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0
1 1 1 0 1 1 1 0 0 0 -------> 0 0 0 0 1 0 0 0 0 0
1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0
1 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0
1 1 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 0 0
1 1 1 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 1
1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
Here a Boolean matrix let call it A matrix and A(NxN) and here N=10. 0 mean there is no connection between nodes(as it can be seen there is no self connection also) and 1 means there is connection between nodes.
Here the first local node is node1 and when a node is local then must be blocked so can not be selected (connected) again
Node 1 connect node 2, then node 2 is local (must be blocked)
2 connect 3, now 3 is local (must be blocked)
3 connect 4, 4 is local (must be blocked)
4 connect 5, 5 is local (must be blocked)
5 connect 6 ,6 is local (must be blocked)
6 connect 8, 8 is local (must be blocked)
8 connect 7, 7 is local (must be blocked)
7 connect 9, 9 is local (must be blocked)
9 connect 10,10 is local and stop here as all number are local.here 10 can not connect 1 about one was local
After connections matrix should be as the matrix at the end of figure. How can i write it in matlab
Here is one way to make the matrix you describe, without further details i cannot see if it really matches what you are looking for but you should be able to edit it yourself.