<｜begin▁of▁sentence｜>### Instruction:
As a Robotics Technician responsible for installing, maintaining, and repairing robotic systems in a manufacturing plant, you are tasked with optimizing the collaboration network of different departments to enhance efficiency. Using the Leiden algorithm available in the cdlib library, you need to perform community detection on the collaboration graph of the departments' interactions in the plant, which can be read from a GML file named cond-mat-2005.gml. Additionally, you are required to convert the obtained NodeClustering object to a JSON representation for further analysis and presentation to the management team.
### Response:
import networkx as nx
from cdlib import algorithms

# Reading the condensed matter collaborations 2005 graph
G = nx.read_gml('cond-mat-2005.gml')

# Applying Leiden algorithm for community detection
communities = algorithms.leiden(G)

# Convert the NodeClustering object to JSON
clusters_json = communities.to_json()

print(clusters_json)
<|EOT|>
