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 plot
|
||||||
from src import fitting
|
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):
|
def leverage(g, weight):
|
||||||
# VertexPropertyMap
|
# VertexPropertyMap
|
||||||
vp = g.new_vertex_property("double")
|
vp = g.new_vertex_property("double")
|
||||||
@@ -144,7 +154,6 @@ fig_graph.savefig("Pointcloud_graph.svg", format='svg')
|
|||||||
fig = plt.figure(figsize=(15, 10))
|
fig = plt.figure(figsize=(15, 10))
|
||||||
axs = fig.subplots(2, 4)
|
axs = fig.subplots(2, 4)
|
||||||
|
|
||||||
i = 0
|
|
||||||
for ax in axs:
|
for ax in axs:
|
||||||
# TODO select corresponding centrality measure method
|
# TODO select corresponding centrality measure method
|
||||||
apply(g, seed, weight, convex_hull, ax, closeness, "Closeness")
|
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, betweeness, "Betweeness")
|
||||||
apply(g, seed, weight, convex_hull, ax, eigenvector, "Eigenvector")
|
apply(g, seed, weight, convex_hull, ax, eigenvector, "Eigenvector")
|
||||||
apply(g, seed, weight, convex_hull, ax, katz, "Katz")
|
apply(g, seed, weight, convex_hull, ax, katz, "Katz")
|
||||||
# TODO to implement
|
apply(g, seed, weight, convex_hull, ax, hits, "Hits")
|
||||||
# - Laplacian
|
apply(g, seed, weight, convex_hull, ax, leverage, "Leverage")
|
||||||
# - Leverage
|
apply(g, seed, weight, convex_hull, ax, degree, "Degree")
|
||||||
# - Degree (seriously?)
|
|
||||||
i += 1
|
|
||||||
|
|
||||||
fig.savefig(f"Comparison_Pointcloud.svg", format='svg')
|
fig.savefig(f"Comparison_Pointcloud.svg", format='svg')
|
||||||
|
|||||||
Reference in New Issue
Block a user