java吧 关注:1,260,955贴子:12,757,473
  • 1回复贴,共1

求助!!!约束满足问题(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怎么实现


IP属地:日本1楼2015-06-07 13:11回复
    自顶,求大神帮帮小女子呀


    IP属地:日本2楼2015-06-07 13:14
    回复