此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

MinCut

MinCut[g, k]
partitions the undirected graph g into k parts where the number of edge cuts is approximately minimized.
  • MinCut treats the input as an undirected graph, and tries to find a partition of the vertices into k parts so that each part has roughly the same number of vertices, and so that the number of edges between these parts (known as the edge separator) is minimized.
Needs["GraphUtilities`"]
This defines a small graph:
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
This partitions the vertices into two parts with the minimum number of edge cuts:
In[4]:=
Click for copyable input
Out[4]=
This plots the graph with partitions, with one part colored red and the other colored green:
In[5]:=
Click for copyable input
Out[5]=