« first day  last day (14 days later) » 

6:33 AM
Thanks. The problem occurs when we have an input like this:
z1 = {1 <-> 2, 1 <-> 3, 1 <-> 4, 1 <-> 5, 1 <-> 6, 1 <-> 7, 1 <-> 8,
1 <-> 9, 1 <-> 10, 1 <-> 11, 1 <-> 12, 9 <-> 13, 1 <-> 14, 1 <-> 15,
1 <-> 16, 12 <-> 17, 1 <-> 18, 12 <-> 19, 12 <-> 20, 1 <-> 21,
1 <-> 22, 1 <-> 23, 8 <-> 24, 4 <-> 25, 4 <-> 26, 20 <-> 27,
27 <-> 28, 28 <-> 29}
The reverse transformation of the output gives: {1 <-> 2, 1 <-> 3, 1 <-> 4, 1 <-> 5, 1 <-> 6, 1 <-> 7, 1 <-> 8,
1 <-> 9, 1 <-> 10, 1 <-> 11, 1 <-> 12, 9 <-> 13, 1 <-> 14, 1 <-> 15,
1 <-> 16, 12 <-> 17, 1 <-> 18, 12 <-> 19, 12 <-> 20, 1 <-> 21,
1 <-> 22, 1 <-> 23, 8 <-> 24, 4 <-> 25, 4 <-> 26}. So the code does not see node 27, 28, 29.
 
6:52 AM
I think that finding the correct output for this case is impossible because it does not exist.
We can possibly reduce (at the beginning) the input graph (z1) into the graph in which there are no such cases as: {1 <-> 2, 1 <-> 3, 1 <-> 4, 1 <-> 5, 1 <-> 6, 1 <-> 7, 1 <-> 8,
1 <-> 9, 1 <-> 10, 1 <-> 11, 1 <-> 12, 9 <-> 13, 1 <-> 14, 1 <-> 15,
1 <-> 16, 12 <-> 17, 1 <-> 18, 12 <-> 19, 12 <-> 20, 1 <-> 21,
1 <-> 22, 1 <-> 23, 8 <-> 24, 4 <-> 25, 4 <-> 26, 20 <-> 27,
27 <-> 28, 28 <-> 29, 29 <-> 30, 30 <-> 31}
to case without edge 27 <-> 28, 28 <-> 29, 29 <-> 30, 30 <-> 31
Then we get a result closer to reality
 
 
1 hour later…
8:15 AM
This case also gives an incorrect result:
z1 = {1 <-> 2, 1 <-> 3, 1 <-> 4, 1 <-> 5, 1 <-> 6, 1 <-> 7, 1 <-> 8,
1 <-> 9, 1 <-> 10, 1 <-> 11, 1 <-> 12, 9 <-> 13, 1 <-> 14, 1 <-> 15,
1 <-> 16, 12 <-> 17, 1 <-> 18, 12 <-> 19, 12 <-> 20, 1 <-> 21,
1 <-> 22, 1 <-> 23, 8 <-> 24, 4 <-> 25, 4 <-> 26, 20 <-> 27,
17 <-> 29, 17 <-> 30, 17 <-> 31}
... and that's weird
without edge 17 <-> 31 is ok
 
 
8 hours later…
4:12 PM
@ralph you clearly didn't read my answer.
Because I addressed both of those cases.
One can prove that won't work.
As I said and you didn't read:
For a reversible mapping to exist, each child node of a node n with degree d must have degree strictly less than d.
And you can generalize this one step further.
For a node of degree d the sum of the degrees of its child nodes must be less than or equal to (d-1 + d-2 + ... + 1).
So learn the math.
@ralph so please, in the future, read the answers people give you. Okay? And learn the underlying math. If you're not familiar with graph theory, read a tutorial.
And @ralph, for like the 18th time, tag me when you say things or there's no guarantee I'll ever see it. I only saw this because I was going to the standard Mathematica chat and it was under that.
 
5:01 PM
@MB1965. Last request. Can you simplify your code to such a form to designate only a set of edges (for unSpoolGraph), without coloring, etc .. The point is that I'm doing calculations for large networks and I'm missing the RAM memory. Thank you for everything.
 
You can pull that out yourself, I'm sure.
Use EdgeList
If you just want the edges without rendering
do g=unSpoolGraph[<input>];EdgeList@g
 

« first day  last day (14 days later) »