### python graph code

Can anyone help me in this program: make*complete*graph(num

*nodes) - Takes the number of nodes num*nodes and returns a dictionary corresponding to a complete directed graph with the specified number of nodes. A complete graph contains all possible edges subject to the restriction that self-loops are not allowed. The nodes of the graph should be numbered 0 to num

*nodes - 1 when num*nodes is positive. Otherwise, the function returns a dictionary corresponding to the empty graph.

`def make_complete_graph(num_nodes):
`

"""this is a method used for making dictionary for compleate graph"""

dic={}; #empty dictionary for graph

__node_a=0; #node A

__node_a=0; #node B

"""this function is used for calculate the dictionary for simple complete graph"""

for node_a in range(0,num_nodes): #two loops for finding the each combination of nodes

for node_b in range(0,num_nodes):

if(node_a!=node_b):

dic[node_a]=dic[node_a].append(node_b); #if two nodes are not equals the add and edge between them

return dic; # return the dictionary for graph

i=int(input()) # take no of node in graph

print(make_complete_graph(i)); # call method make_complete_graph

## Answers

Christian Calderon its a undirected complete graph where each node connected with other node using an edge. e.g. given bellow

Do you mean, a complete digraph? every pair of nodes is joined by two edges?

Finding every unique pair is a piece of cake. That is what you are doing right? Basically making an unbalanced tree to represent each pair of nodes?

Finding every unique pair is a piece of cake. That is what you are doing right? Basically making an unbalanced tree to represent each pair of nodes?