Beispiel #1
0
        SteinerTree st; //

        #endregion Fields

        #region Constructors

        //int buttonMode;
        //const int BUTTON_MODE = 2;      //主按钮模式切换 0画数据图 1画Steiner树
        /// <summary>
        /// 主窗口
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            // 初始化
            dbm = new DBManager();
            count = dbm.getNodeNum();
            gm = new GraphManager(count);
            dbm.initGraph(gm);
            datagraph = new DataGraphGeometry();
            textBlockInfo.Text = "Ready.";          //状态信息显示
        }
Beispiel #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="gm">图结构</param>
 /// <param name="dbm">数据库管理类</param>
 /// <param name="keyword">关键词集合</param>
 public SteinerTree(GraphManager gm, DBManager dbm, string[] keyword)
 {
     //this.gm = gm;
     isReached = new bool[gm.nodeNum];
     for (int i = 0; i < isReached.Length; i++)
     {
         isReached[i] = false;
     }
     dictVL = new Dictionary<int, List<int>>();
     dictVL2 = new Dictionary<int, List<int>>();
     dictDijkstra = new Dictionary<int, Dijkstra>();
     iterator = new List<Dijkstra>();
     keywordSet = new List<List<int>>();
     keywordIndex = dbm.getKeywordSets(keyword, gm, keywordSet);
     foreach (int item in keywordIndex)
     {
         Dijkstra dkInterator = new Dijkstra(gm, item);
         dictDijkstra.Add(item, dkInterator);
         iterator.Add(dkInterator);
         dkInterator.execute();
         dkInterator.getNextNode();
     }
     steinerTreeNode = new List<int>();
     steinerTreeEdge = new List<edge>();
 }