批处理作业调度问题(分支限界法)

本文深入探讨了批处理作业调度问题,并利用分支限界法进行求解。通过实例分析,展示了如何应用该算法有效地优化作业执行顺序,以达到减少总体周转时间或提高系统吞吐量的目标。
摘要由CSDN通过智能技术生成

代码:

#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 =
  • 1
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值