0

So I have a graph with vertices that are connected by edges. The min cut is a function that calculates the minimum number of edges which allows the graph to be separated into two connected subgraphs. So the problem I have is that the min cut function does not give me a balanced cut, i.e. the graph is divided into two: a subgraph and a vertex, and the worst case of my problem is when the vertex appears in the decomposition of the graph. Any solution?

for the code in python:

import networkx as nx

A=nx.Graph()
A.add_edges_from([(1,2),(1,3),(1,4),(1,5),(2,3),(2,4),(2,5),(3,4),(3,5),(4 ,5)])

A.remove_edges_from(nx.minimum_edge_cut(A))
nx.draw_networkx(A)

Before decomposition:
enter image description here

After decomposition:
enter image description here

Vitalizzare
  • 4,496
  • 7
  • 13
  • 32
Ali
  • 1
  • 1
  • "Returns a set of edges of minimum cardinality that disconnects G" - doc doesn't mention anything about making the graph balanced - just disconnected. – rdas Oct 11 '22 at 08:33
  • If you have seen the example , the decomposition gives me a single node and another subgraph , that's the worst case for me . So that's why i'm looking for a minimum cut that has the best balance of node numbers in each component . – Ali Oct 11 '22 at 10:09
  • min-cut is minimum in the number of edges (required to make the graph disconnected)- it makes no guarantees about the number of nodes in the subgraphs. You're probably looking for some other algorithm or you need to tweak the structure of your graph in some way to make the algorithm produce what you want – rdas Oct 11 '22 at 10:27
  • can u suggest me an algorithm that can give me a balanced decomposition of a graph( a balanced decomposition means that when the graph is divided into two subgraphs , no one of those subgraphs contain a single vertex ) ? – Ali Oct 12 '22 at 13:08

0 Answers0