<｜begin▁of▁sentence｜>### Instruction:
As the librarian, you have been tasked with organizing the library's collection of books and documents to assist patrons in finding relevant materials. You are also exploring new methods to group related materials together for easier access. Using the EgoNetSplitter model, you want to detect overlapping themes among the library's collection and provide the cluster memberships for better resource organization.
### Response:
import networkx as nx
from karateclub import EgoNetSplitter

# Generate a synthetic graph
g = nx.newman_watts_strogatz_graph(100, 3, 0.5)

# Initialize EgoNetSplitter with default parameters
model = EgoNetSplitter()

# Fit the model to the graph
model.fit(g)

# Get the cluster memberships of the nodes
memberships = model.get_memberships()

print(memberships)
<|EOT|>
