isdag
グラフが非循環かどうかの判定
説明
例
有向グラフが非循環かどうかの判定
有向グラフを作成してプロットし、次にグラフをテストして非循環かどうかを判定します。
s = [1 1 2 2 3 3 4 4 4 5]; t = [2 3 4 5 6 7 8 9 10 4]; G = digraph(s,t)
G = digraph with properties: Edges: [10x1 table] Nodes: [10x0 table]
plot(G)
tf = isdag(G)
tf = logical
1
入力引数
詳細
有向非循環グラフ (DAG)
循環を含まない有向グラフは非循環です。つまり、グラフの任意のノードから開始し、どの一連のエッジに沿って進んでもその開始ノードにループバックできません。その結果、有向非循環グラフには自己ループがありません。
バージョン履歴
R2015b で導入
参考
toposort
| reordernodes
| digraph
| hascycles
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)