diff --git a/lib/mosaik/algorithms/louvain.rb b/lib/mosaik/algorithms/louvain.rb index 8474ade..3098ef0 100644 --- a/lib/mosaik/algorithms/louvain.rb +++ b/lib/mosaik/algorithms/louvain.rb @@ -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) } diff --git a/lib/mosaik/commands/identify.rb b/lib/mosaik/commands/identify.rb index 2644c34..65a1b8a 100644 --- a/lib/mosaik/commands/identify.rb +++ b/lib/mosaik/commands/identify.rb @@ -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