So I am trying to use graphviz package on python and it has a method named subgraph()
but I think it's different from the definition widely used in network theory.
As far as I know, subgraph means a graph whose nodes and edges are subsets of another graph.
On graphviz user guide it says:
Add the current content of the given sole graph argument as subgraph or return a context manager returning a new graph instance created with the given (name, comment, etc.) arguments whose content is added as subgraph when leaving the context manager’s with-block.
This is an example from user guide
import graphviz
p = Graph(name='parent')
p.edge('spam', 'eggs')
c = Graph(name='child', node_attr={'shape': 'box'})
c.edge('foo', 'bar')
p.subgraph(c)
According to the network theory, graph p should have all nodes 'spam', 'eggs', 'foo', 'bar' and subgraph c should be made from nodes and edges used in graph p.
But it's not. It seems like subgraph() method just adds two graphs into one. Am I right?
And what is a special cluster subgraph? (If the name of a subgraph begins with 'cluster' the layout engine will treat it as a special cluster subgraph). I can't find any result in google.
Thank you