csp可以java_求助!!!约束满足问题(CSP)如何用java实现

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

Scheduling is a common CSP. You are to find a feasible meeting schedule that satisfies the constraints of each of the employees in a company. The description of our scheduling problem is as follows:

• There is a set of M employees.

• There is a set of N meetings, each of which has a duration of one time unit.

• The schedule has a maximum number T of time slots.

• Each employee has a set of meetings that he or she must attend.

• The scheduled time slots for meetings must enable the participating employees to travel between the respective meeting locations.

following sample problem:

Number of meetings: 5

Number of employees: 6

Number of time slots: 5

Meetings each employee must attend:

1: 2 5

2: 2 3

3: 1 5

4: 1 4 5

5: 2 4

6: 1 3

// This specifies the time required to travel from one meeting location to the other.

// For example, getting from meeting 2 to meeting 3 requires one time slot,

// and getting from meeting 1 to meeting 5 requires two time slots.

Travel time between meetings:

1 2 3 4 5

1: 0 1 2 1 2

2: 1 0 1 1 1

3: 2 1 0 1 1

4: 1 1 1 0 1

5: 2 1 1 1 0

Here is the solution for the sample problem (you should report yours in a similar format):

Meeting 1 is scheduled at time 1

Meeting 2 is scheduled at time 1

Meeting 3 is scheduled at time 5

Meeting 4 is scheduled at time 3

Meeting 5 is scheduled at time 5

这个算法用java怎么实现

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值