Click here to Skip to main content
15,885,133 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello everyone,

Case Scenario :

Exams : 1, 2, 3, 4
Seats : A, B, C, D, E
Students : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Student-Exam-Map :
Exam	Student
1	1
1	2
1	3
1	4
1	5
2	1
2	3
2	5
2	7
2	9
3	2
3	4
3	6
3	8
3	10
4	1
4	3
4	2
4	5
4	10


Problem : One student can have only one seat for all exams, i can allot one seat to more than student but without conflict.

What kind of problem it is and what algorithm should i use?

Thank you

What I have tried:

I have prepared a chart to allot seat and sequentially allot seats using for loop.
The chart is :

Exam/Seat	1	2	3	4
A		1	1	6	1
B		2	7	2	2
C		3	3	8	3
D		4	9	4	
E		5	5	10


Invalid solution because for last 2 rows both 5 and 10 student require Seat E.
Posted
Updated 12-Oct-17 17:37pm
v4
Comments
PIEBALDconsult 12-Oct-17 23:39pm    
Not enough information.
Raghubir_Sarkar 13-Oct-17 1:50am    
I tried to provide all information, if you want to know anything else about the question please ask me.

1 solution

Quote:
What kind of problem it is and what algorithm should i use?

I would use a brute force backtracking algorithm.

As far as I can see, there is no solution to this dataset.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900