INCF / swc-specification

Information about the SWC file specification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specify what types of graphs can be represented with this format.

tathey1 opened this issue · comments

Seems like this format can encode directed graphs that have |E|=|N|-1. where |E| is number of edges and |N| is number of nodes. However, unless enforced explicitly, this format is not constrained to trees. (e.g. there might be multiple connected components or loops).

Might be worth making a note that a SWC might encode things other than trees.

Could you please provide an example that conforms with the standard (please note for example that parents must occur before they are referenced), and is a loop?

What I was thinking was:

ID parent_ID

1 -1
2 4
3 2
4 3

I believe this is a valid swc because the first node is the root node, and every node has a unique parent. However there are two connected components here, {1},{2,3,4}. Further {2,3,4} form a loop.

My point is that I think the ID/parent ID format does not constrain the graph to be a tree. If we want to enforce that a given SWC is a tree, I think will need to do some additional processing.

According to the standard, this is not a valid SWC; a parent (4) is referenced by a child (2) before it occurs. This is not allowed.
I share your concerns about not allowing loops, but I think this specific constraint mitigates this. Please correct me if I am wrong and provide a counter-example.

oh great!! thanks for demonstrating this for me. With this requirement, looks like you could prove that it's a tree with induction. Wonderful.

You are welcome!