
3.14 以 Combinatorica` 套件建立圖(Graph)
|
135
如果你的圖有某種規律,可使用
MakeGraph
指令建立。
討論說明
你也可以由既有圖建構新圖,指令為
GraphUnion
、
GraphIntersection
、
GraphDifference
、
GraphProduct
與
GraphJoin
等,以下範例將逐一介紹,範例中僅使用二個圖進行運算,
但實際上也支援多圖運算。
GraphUnion
指令將以聯集動作建立互斥圖(disjoint graph)。[Page-136]
ch03.indd 135 2014/4/7 下午 12:21:15