I've a graph like " A-->B-->C " now i removed vertex "B". Now my graph contains vertices A and C and no edges, here C is the leaf node it doesn't linked with any other nodes. Now my doubt is what is advantage of leaf nodes when they doesn't contain relation ship with any other nodes.(It is memory wastage right..?)
Asked
Active
Viewed 156 times
0
-
Graph is only an imagined structure. It is only useful when you associate with something real. So whether "C" is useful depends on your usage. – johnchen902 Jul 05 '13 at 06:22
-
No 'C' is not useful in my graph – Subbu Jul 05 '13 at 07:08
-
See if my graph contain 1000's leaf nodes like 'C'. What about my memory usage? – Subbu Jul 05 '13 at 07:13
-
If your code works if you remove `C`s, you can remove them. – johnchen902 Jul 05 '13 at 07:16
-
For small number of vertices it is ok we can remove but if my graph contain 1000's or lack leaf nodes it is very difficult to delete all vertices right?? – Subbu Jul 05 '13 at 07:20
-
Is it titan providing any method to delete these type of leaf nodes? – Subbu Jul 05 '13 at 07:21
-
I only know a little about graphs. I don't know anything about titan. – johnchen902 Jul 05 '13 at 07:29
1 Answers
2
It depends on whether you plan to link back up with C node. If C cannot ever possibly be used again in your use case, then yes, C is a waste of resources.
It depends on your Graph's purpose.

William Morrison
- 10,953
- 2
- 31
- 48