Skip to content

NodeClustering methods are failing for "r_spectral_clustering" #253

Description

@lior0110

Describe the bug
NodeClustering methods are failing for "r_spectral_clustering"

To Reproduce
Steps to reproduce the behavior:

  • CDlib version : cdlib 0.4.0
  • Operating System : windows 11
  • Python version : 3.11.11
  • Version(s) of CDlib required libraries

from cdlib import algorithms
import networkx as nx
G = nx.karate_club_graph()
coms = algorithms.r_spectral_clustering(G, n_clusters=2, method="regularized", percentile=20).size()

Expected behavior
A clear and concise description of what you expected to happen.
before fix:
FitnessResult(min=0, max=0, score=0.0, std=0.0)
when working:
FitnessResult(min=9, max=22, score=14.9, std=4.109744517606903)

Screenshots
If applicable, add screenshots to help explain your problem.
before fix:

Image

after fix:

Image

Additional context
needs to change "g = convert_graph_formats(g_original, nx.Graph)" to "g = convert_graph_formats(g_original.copy(), nx.Graph)" in source code crisp_partition.py to work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions