package org.cloudbus.cloudsim.codes.minispanningtree;

import java.util.Arrays;

/**
 * ClassName Test
 * Description
 * Create by HW
 * Date 2022/5/16 20:59
 */
public class Test {
    public static void main(String[] args) {
        Graph graph = new Graph();

        graph.creatGraph("V0","V1",10);
        graph.creatGraph("V0","V5",11);
        graph.creatGraph("V1","V2",18);
        graph.creatGraph("V1","V8",12);
        graph.creatGraph("V1","V6",16);
        graph.creatGraph("V2","V8",8);
        graph.creatGraph("V2","V3",22);
        graph.creatGraph("V3","V8",21);
        graph.creatGraph("V3","V6",24);
        graph.creatGraph("V3","V7",16);
        graph.creatGraph("V3","V4",20);
        graph.creatGraph("V4","V7",7);
        graph.creatGraph("V4","V5",26);
        graph.creatGraph("V5","V6",17);
        graph.creatGraph("V6","V7",19);

        graph.minitree();

        int[] dist=new int[5];			//dist[i]存放结点i到已访问结点的最小权值
        Arrays.fill(dist, Integer.MAX_VALUE);
        for (int i = 0; i < dist.length; i++) {
            System.out.println(dist[i]);
        }
    }
}
