// Use this for initialization void Start() { //测试图的基本功能 // testGraphBasicOperation (); //从File读取图 print("*********测试稠密图的读取文件获得数据*********"); string filename1 = "testG1.txt"; string filename2 = "testG2.txt"; string url = FileHelper.FileNameHelper(filename1); bool isDirect = false; DenseGraph dGraph = null; ReadGraph.ReadGraphFromFile(url, out dGraph, isDirect); dGraph.print(); dGraph = null; ReadGraph.ReadGraphFromFile(url, out dGraph, isDirect); url = FileHelper.FileNameHelper(filename2); ReadGraph.ReadGraphFromFile(url, out dGraph, isDirect); dGraph.print(); print("*******************************************"); print("*********测试稀疏图的读取文件获得数据*********"); url = FileHelper.FileNameHelper(filename1); SpareGraph sGraph = null; ReadGraph.ReadGraphFromFile(url, out sGraph, isDirect); sGraph.print(); sGraph = null; ReadGraph.ReadGraphFromFile(url, out sGraph, isDirect); url = FileHelper.FileNameHelper(filename2); ReadGraph.ReadGraphFromFile(url, out sGraph, isDirect); sGraph.print(); }
// Use this for initialization void Start() { string filename = "testG1.txt"; SpareGraph sGraph = null; string url = FileHelper.FileNameHelper(filename); ReadGraph.ReadGraphFromFile(url, out sGraph, false); sGraph.print(); Components SpareGraphcomponent = new Components(sGraph); SpareGraphcomponent.MinLength1(0); SpareGraphcomponent.MinLength(0); }
public void testNormalComponent() { print("******测试稠密图的深度优先搜索******"); DenseGraph dGraph = null; string filename = "testG1.txt"; string url = FileHelper.FileNameHelper(filename); ReadGraph.ReadGraphFromFile(url, out dGraph, false); Components DenseGraphcomponent = new Components(dGraph); print("******测试稀疏图的深度优先搜索******"); SpareGraph sGraph = null; url = FileHelper.FileNameHelper(filename); ReadGraph.ReadGraphFromFile(url, out sGraph, false); sGraph.print(); Components SpareGraphcomponent = new Components(sGraph); }