#include "..\CookHeader.h"

typedef  Array <Array <int>> Graph;
Graph initGraph(int size) {
	Graph G;
	Array <int> tmpAry;
	for (int i = 0; i < size; i++) {
		tmpAry.clear();
		for (int k = 0; k < size; k++)
			tmpAry.push_back(0);
		G.push_back(tmpAry);
	}
	return G;
}

Graph G1;
Array <string> nameAry = { "문별", "솔라", "휘인", "쯔위", "선미", "화사" };
int 문별 = 0, 솔라 = 1, 휘인 = 2, 쯔위 = 3, 선미 = 4, 화사 = 5;

void printGraph(Graph g) {
	print("    ");
	for (int v = 0; v < len(g); v++)
		print(nameAry[v]);
	println("");
	for (int row = 0; row < len(g); row++) {
		print(nameAry[row]+" ");
		for (int col = 0; col < len(g[row]); col++) {
			print(g[row][col]);
			print("  ");
		}
		println("");
	}
	println("");
}

int main() {
	int gSize = 6;
	G1 = initGraph(gSize);
	G1[문별][솔라] = 1; G1[문별][휘인] = 1;
	G1[솔라][문별] = 1; G1[솔라][쯔위] = 1;
	G1[휘인][문별] = 1; G1[휘인][쯔위] = 1;
	G1[쯔위][솔라] = 1; G1[쯔위][휘인] = 1; G1[쯔위][선미] = 1; G1[쯔위][화사] = 1;
	G1[선미][쯔위] = 1; G1[선미][화사] = 1;
	G1[화사][쯔위] = 1; G1[화사][선미] = 1;

	println("## G1 무방향 그래프 ##\n");
	printGraph(G1);
}