<jupyter_start><jupyter_text>Data 620 Assignment:  “hello, graph world” In this assignment, you’re asked to create the nodes and edges for a basic graph, such as the Krackhardt kite shown below.<jupyter_code>import networkx as nx
import matplotlib.pyplot as plt
# initialize the graph
G=nx.Graph()
# add the nodes
G.add_node('Andre') 
G.add_node('Beverly') 
G.add_node('Carol')
G.add_node('Diane') 
G.add_node('Ed')
G.add_node('Fernando')
G.add_node('Garth')
G.add_node('Heather')
G.add_node('Ike')
G.add_node('Jane')
# add the edges
G.add_edge('Andre','Beverly')
G.add_edge('Andre', 'Carol')
G.add_edge('Andre', 'Diane')
G.add_edge('Andre', 'Fernando')
G.add_edge('Beverly', 'Diane')
G.add_edge('Beverly', 'Ed')
G.add_edge('Beverly', 'Garth')
G.add_edge('Carol', 'Diane')
G.add_edge('Carol', 'Fernando')
G.add_edge('Diane', 'Ed')
G.add_edge('Diane', 'Fernando')
G.add_edge('Diane', 'Garth')
G.add_edge('Ed', 'Garth')
G.add_edge('Fernando', 'Garth')
G.add_edge('Fernando', 'Heather')
G.add_edge('Garth', 'Heather')
G.add_edge('Heather', 'Ike')
G.add_edge('Ike', 'Jane')
# check the number of nodes
G.number_of_nodes()
# check the number of edges
G.number_of_edges()
# set the positions for the nodes
pos = {'Andre': (0, 1),
       'Beverly': (0, -1),
       'Carol': (1, 2),
       'Diane': (1, 0),
       'Ed': (1, -2),
       'Fernando': (2, 1),
       'Garth': (2, -1),
       'Heather': (3, 0),
       'Ike': (4, 0),
       'Jane': (5, 0)}
# draw the graph
nx.draw_networkx(G, pos, with_labels=True, node_size = 1000, node_color = 'yellow', font_size = 10, node_shape = 's')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20135886349598517, 'fraction_numerical': 0.017912291537986413, 'mean_word_length': 4.977859778597786, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '281465', 'license': 'MIT', 'n_tokens_mistral': 704, 'n_tokens_neox': 677, 'n_words': 154, 'path': 'Assignment_1/620_HW_1-Sheryl.ipynb', 'repo_name': 'jitsen-design/Data_620_Group', 'size': '1619'}