#include
#include
int graph[9][9] = {
{0,0,0,0,0,0,0,0,0},
{0,0,2,8,0,0,0,0,0},
{0,2,0,7,9,0,0,0,0},
{0,8,7,0,4,10,12,0,0},
{0,0,9,4,0,0,0,0,0},
{0,0,0,10,0,0,6,14,0},
{0,0,0,12,0,6,0,0,0},
{0,0,0,0,0,14,0,0,3},
{0,0,0,0,0,0,0,3,0}
};
int spanningtree[9][9] = {
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0}
};
int visited[9] = {0,0,0,0,0,0,0,0,0};
int def = 0; // 싸이클 체크시, 사이클 발생하면 1, 발생 안하면 0
int edge_cnt; // 간선의 개수
typedef struct edge
{
int start; // start
int finish; // destination
int weight;
} edge;
edge edgelist[10] = { 0 };
int edge_count(int graph[9][9]) ;
void reset_visited();
int cycle_check(int v, int ban);
int sequence(int s, int d);
void print_graph(int arr[9][9]);