Compare commits
2 Commits
20a7854d0c
...
32dd37feea
| Author | SHA1 | Date | |
|---|---|---|---|
| 32dd37feea | |||
| b2edb8265b |
@@ -8,6 +8,16 @@ from src import centrality
|
||||
from src import plot
|
||||
from src import fitting
|
||||
|
||||
|
||||
def degree(g, weight):
|
||||
# VertexPropertyMap
|
||||
vp = g.new_vertex_property("double")
|
||||
for v in g.vertices():
|
||||
neighbours = g.get_all_neighbours(v)
|
||||
vp[v] = len(neighbours)
|
||||
return vp
|
||||
|
||||
|
||||
def leverage(g, weight):
|
||||
# VertexPropertyMap
|
||||
vp = g.new_vertex_property("double")
|
||||
@@ -144,7 +154,6 @@ fig_graph.savefig("Pointcloud_graph.svg", format='svg')
|
||||
fig = plt.figure(figsize=(15, 10))
|
||||
axs = fig.subplots(2, 4)
|
||||
|
||||
i = 0
|
||||
for ax in axs:
|
||||
# TODO select corresponding centrality measure method
|
||||
apply(g, seed, weight, convex_hull, ax, closeness, "Closeness")
|
||||
@@ -152,10 +161,8 @@ for ax in axs:
|
||||
apply(g, seed, weight, convex_hull, ax, betweeness, "Betweeness")
|
||||
apply(g, seed, weight, convex_hull, ax, eigenvector, "Eigenvector")
|
||||
apply(g, seed, weight, convex_hull, ax, katz, "Katz")
|
||||
# TODO to implement
|
||||
# - Laplacian
|
||||
# - Leverage
|
||||
# - Degree (seriously?)
|
||||
i += 1
|
||||
apply(g, seed, weight, convex_hull, ax, hits, "Hits")
|
||||
apply(g, seed, weight, convex_hull, ax, leverage, "Leverage")
|
||||
apply(g, seed, weight, convex_hull, ax, degree, "Degree")
|
||||
|
||||
fig.savefig(f"Comparison_Pointcloud.svg", format='svg')
|
||||
|
||||
Reference in New Issue
Block a user