Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! python3
- import networkx as nx
- g = nx.DiGraph()
- g_sec = nx.DiGraph()
- r = set(['protocolMessage', 'CancelArguments', 'InitReqArguments', 'AttachRequestArguments'])
- # first graph
- g.add_edge('protocolMessage', 'request')
- g.add_edge('protocolMessage', 'event')
- g.add_edge('protocolMessage', 'response')
- g.add_edge('request', 'CancelRequest')
- g.add_edge('request', 'RunInTermRequest')
- g.add_edge('request', 'AttachRequest')
- g.add_edge('AttachRequestArguments', 'AttachRequest')
- g.add_edge('event', 'InitEvent')
- g.add_edge('event', 'StopEvent')
- g.add_edge('response', 'ErrorResponse')
- g.add_edge('response', 'CancelResponse')
- # second graph
- g_sec.add_edge('request' , 'protocolMessage' )
- g_sec.add_edge('event' , 'protocolMessage' )
- g_sec.add_edge('response', 'protocolMessage' )
- g_sec.add_edge( 'CancelRequest' , 'request' )
- g_sec.add_edge( 'RunInTermRequest','request' )
- g_sec.add_edge( 'AttachRequest', 'request' )
- g_sec.add_edge( 'AttachRequest', 'AttachRequestArguments' )
- g_sec.add_edge('InitEvent','event')
- g_sec.add_edge('StopEvent','event')
- g_sec.add_edge('ErrorResponse', 'response')
- g_sec.add_edge('CancelResponse','response')
- # L.append((list(nx.dfs_edges(g, s))))
- # So after some investigation I come to several epiphanies:
- # first: I need to use the second way of using the graph
- # second: It's 2:30AM
- # third: It's no time to work but to sleep
- # forth: I really need to consult a psychologist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement