isdag
그래프가 비순환(Acyclic)인지 확인
설명
tf = isdag(
는 G
)G
가 유방향 비순환 그래프인 경우 논리값 1
(true
)을 반환합니다. 그렇지 않으면, 논리값 0
(false
)을 반환합니다.
예제
유방향 그래프가 비순환(Acyclic)인지 확인하기
유방향 그래프를 생성하고 플로팅한 다음 테스트를 통해 그래프가 비순환인지 여부를 확인합니다.
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, Directed Acyclic Graph)
순환이 없는 유방향 그래프는 비순환 그래프입니다. 즉, 그래프의 한 노드에서 순환이 시작하여 다시 이 시작 노드로 이어지는 일련의 간선이 없습니다. 결과적으로 유방향 비순환 그래프에는 자가 루프가 포함되지 않습니다.
버전 내역
R2015b에 개발됨
참고 항목
toposort
| reordernodes
| digraph
| hascycles
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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)