<jupyter_start><jupyter_text>Visualize gSparse's Dumbell Graph with Networkx package<jupyter_code>import networkx as nx
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>A 60 vertices Dumbell<jupyter_code>H = nx.read_edgelist(path="../Dataset/dumbell-30.csv", delimiter=' ', nodetype=int, encoding="utf-8")
fig = plt.figure(figsize=(10,10))
pos = nx.spring_layout(H,scale=3.0)
nx.draw(H,pos=pos)

nx.node_attribute_xy
plt.show()
fig.savefig("D-1.pdf")<jupyter_output><empty_output><jupyter_text>A Sparsifier with Epsilon = 0.25<jupyter_code>allFiles = ['../Dataset/sparsifier-dumbell-eps25-edges.csv',
            '../Dataset/sparsifier-dumbell-eps25-weights.csv']

nodes = np.loadtxt(allFiles[0],delimiter=",")
weight = np.loadtxt(allFiles[1],delimiter=",")
dataset = pd.DataFrame({'source':nodes[:,0],'target':nodes[:,1],'weight':weight})


H=nx.from_pandas_edgelist(dataset, edge_attr=True)
edgewidth = np.array([ float(d['weight']) for (u,v,d) in H.edges(data=True)])

edgewidth = edgewidth * 0.2

fig = plt.figure(figsize=(10,10))
nx.draw(H,pos=pos,width=edgewidth)
plt.show()
fig.savefig("D-2.pdf")<jupyter_output><empty_output><jupyter_text>A Sparsifier with Epsilon = 0.50<jupyter_code>allFiles = ['../Dataset/sparsifier-dumbell-eps50-edges.csv',
            '../Dataset/sparsifier-dumbell-eps50-weights.csv']

nodes = np.loadtxt(allFiles[0],delimiter=",")
weight = np.loadtxt(allFiles[1],delimiter=",")
dataset = pd.DataFrame({'source':nodes[:,0],'target':nodes[:,1],'weight':weight})


H=nx.from_pandas_edgelist(dataset, edge_attr=True)
edgewidth = np.array([ float(d['weight']) for (u,v,d) in H.edges(data=True)])

edgewidth = edgewidth * 0.5

fig = plt.figure(figsize=(10,10))
nx.draw(H,pos=pos,width=edgewidth)
plt.show()
fig.savefig("D-3.pdf")<jupyter_output><empty_output><jupyter_text>A Sparsifier with Epsilon = 0.75<jupyter_code>allFiles = ['../Dataset/sparsifier-dumbell-eps75-edges.csv',
            '../Dataset/sparsifier-dumbell-eps75-weights.csv']

nodes = np.loadtxt(allFiles[0],delimiter=",")
weight = np.loadtxt(allFiles[1],delimiter=",")
dataset = pd.DataFrame({'source':nodes[:,0],'target':nodes[:,1],'weight':weight})


H=nx.from_pandas_edgelist(dataset, edge_attr=True)
edgewidth = np.array([ float(d['weight']) for (u,v,d) in H.edges(data=True)])

edgewidth = edgewidth  * 0.8

fig = plt.figure(figsize=(10,10))
nx.draw(H,pos=pos,width=edgewidth)
plt.show()
fig.savefig("D-4.pdf")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19161676646706588, 'fraction_numerical': 0.026347305389221556, 'mean_word_length': 6.930379746835443, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '609488', 'license': 'MIT', 'n_tokens_mistral': 1030, 'n_tokens_neox': 1014, 'n_words': 124, 'path': 'Visualization/Dumbell-Graph.ipynb', 'repo_name': 'As-12/gSparse', 'size': '2505'}