How to check if a particular node is already present in the graph.
Here is what I have tried.
>>>from graphviz import Digraph
>>>dot = Digraph()
>>>dot.node('solid',xlabel='0')
>>>dot.node('liquid',xlabel='0')
>>>dot.edge('solid','liquid','melt')
>>>print (dot)
digraph {
solid [xlabel=0]
liquid [xlabel=0]
solid -> liquid [label=melt]
}
>>>check = 'solid' in dot
>>>print (solid)
False
As we see here I can't directly check for the node.
I am looking for a way to check if the node has been visited/created before and if that node is visited then increment it's xlabel by 1.
Is there a way to traverse and visit each node in graphviz or do I have to write a separate code to check if a specific node is present?