代码:
#include <bits/stdc++.h>
using namespace std;
const int MAX=100;
const int MACHINE=2;
int n;
int M[MAX][MACHINE];
int b[MAX][MACHINE];
int a[MAX][MACHINE];
int y[MAX][MACHINE];
int bestx[MAX];
int bestc;
struct Node
{
int s;
int f1;
int f2;
int sf2;
int bb;
int *x;
bool operator < (const Node &node) const
{
return bb > node.bb;
}
};
priority_queue<Node> pq;
void initNode(Node &node, int n)
{
node.x = new int[n];
int i;
for(i=0; i<n; i++)
node.x[i] = i;
node.s = 0;
node.f1 = 0;
node.f2 = 0;
node.sf2 = 0;
node.bb = 0;
}
void newNode(Node &node, Node E, int Ef1, int Ef2, int Ebb, int n)
{
node.x = new int[n];
int i;
for(i=0; i<n; i++)
node.x[i] = E.x[i];
node.f1 = Ef1;
node.f2 = Ef2;
node.sf2 = E.sf2 + Ef2;
node.bb = Ebb;
node.s = E.s + 1;
}
void swap(int &a, int &b)
{

本文深入探讨了批处理作业调度问题,并利用分支限界法进行求解。通过实例分析,展示了如何应用该算法有效地优化作业执行顺序,以达到减少总体周转时间或提高系统吞吐量的目标。
最低0.47元/天 解锁文章
9031

被折叠的 条评论
为什么被折叠?



