Compare commits

..

2 Commits

Author SHA1 Message Date
32dd37feea WIP: test relationship with boundary 2026-03-04 15:35:15 +01:00
b2edb8265b add: degree centrality 2026-03-04 15:34:51 +01:00

View File

@@ -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')