Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Print clusters after identifying candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
floriandejonckheere committed Apr 12, 2024
1 parent c900aec commit c535b61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/mosaik/algorithms/louvain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ def call
break if modularity - initial_modularity <= THRESHOLD
end

# Print the community assignments
communities.each do |vertex_id, community|
debug "#{vertex_id} -> #{community.id}"
end

# Return the community assignments
communities
.transform_keys { |vertex_id| graph.find_vertex(vertex_id) }
Expand Down
8 changes: 8 additions & 0 deletions lib/mosaik/commands/identify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ def call
.add_vertex(vertex)
end

# Print the clusters
graph.clusters.each_value do |cluster|
debug "Cluster #{cluster.id}"
cluster.vertices.each do |vertex|
debug " #{vertex.id}"
end
end

file = "#{File.basename(options[:file], '.*')}-candidates"

# Write graph to file
Expand Down

0 comments on commit c535b61

Please sign in to comment.