Skip to content

Commit 928964f

Browse files
committed
feat: 가중치 그래프 인터페이스 선언
1 parent 1c8a177 commit 928964f

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package graph;
2+
3+
public interface MSTConversionAlgorithm {
4+
5+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package graph;
2+
3+
/**
4+
* 가중치 그래프의 인터페이스
5+
*
6+
* @author dion
7+
*/
8+
public interface WeightedGraph extends Graph {
9+
10+
/**
11+
* 매개변수 fromV와 toV로 전달된 정점을 연결하는 간선에 가중치를 부여하여 그래프에 추가합니다.
12+
*
13+
* @param fromV 시작하는 정점
14+
* @param toV 도달하는 정점
15+
* @param weight 간선의 가중치
16+
*/
17+
void addEdge(Enum<?> fromV, Enum<?> toV, int weight);
18+
19+
/**
20+
* 그래프의 간선정보 및 가중치를 반환합니다.
21+
*
22+
* @return 그래프의 간선정보 및 가중치
23+
*/
24+
String showGraphEdgeWeightInfo();
25+
26+
/**
27+
* 알고리즘을 선택해서 최소신장 트리로 변환합니다. (전략 패턴)
28+
*
29+
* @param algorithm 사용할 알고리즘
30+
*/
31+
void convertToMST(MSTConversionAlgorithm algorithm);
32+
}

0 commit comments

Comments
 (0)