最佳调度问题6_8 2011-05-26 21:30:49 测试输入 1 7 3 2 14 4 16 6 5 3 //Author:王子硕 Date:2011/5/26 //Description:最佳调度问题 子集树 分支限界 广度优先 剪枝函数 #include <iostream> #include <fstream> #include <algorithm> #include <functional> #include <queue> using namespace std; class Node{ public: static int k; static int n; Node(); Node(const Node &other); void compute(int i);//当前节点的所需time int time; int t; int *select; int *mac; }; int Node::k = 0; int Node::n = 0; Node::Node(){ time = 0; t = 0; select = new int[n + 1]; mac = new int[k + 1]; int i; for (i = 0; i <= n; ++i) { select[i] = 0; } for (i = 0; i<= k; ++i) { mac[i] = 0; } } Node::Node(const Node &other){ t = other.t; time = other.time