« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Enhanced Graphs and Networks
Graph Partitioning and Cuts
Assign data or processes evenly to a mesh of processors, while minimizing the communication.
In[1]:=
X
mesh = AdjacencyGraph[ ExampleData[{"Matrix", "HB/blckhole"}, "Matrix"], VertexShapeFunction -> None, EdgeShapeFunction -> (Line[#] &), GraphLayout -> "SpectralEmbedding"]
Out[1]=
In[2]:=
X
Short[FindGraphPartition[mesh, 4]]
Out[2]//Short=
Highlight the partitioned mesh of processors.
In[3]:=
X
Short[FindGraphPartition[mesh, 4]]; HighlightGraph[mesh, Subgraph[mesh, #] & /@ %, GraphHighlightStyle -> "DehighlightHide"]
Out[3]=