Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: [OT] simple algorithm for assigning students to class sections

by exussum0 (Vicar)
on Nov 30, 2004 at 14:19 UTC ( #411190=note: print w/replies, xml ) Need Help??


in reply to [OT] simple algorithm for assigning students to class sections

Simpelest and most complex running time solution, create a graph of all students and create vertexes of which ones should not be in the same section. Then try and colour the graph as best you can. If you try to colour the graph by descending order of the degree of their vertexes, you'll get a smaller amount of colours. Each colour represents a section. This method doesn't give the uber best results. There are other graph colouring schemes to produce the optimal number.

Update: as for limiting the amount of people with the same class/colour, you can do that progrematically. Once a colour is all used up, use a new one by force.

----
Then B.I. said, "Hov' remind yourself nobody built like you, you designed yourself"

  • Comment on Re: [OT] simple algorithm for assigning students to class sections

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://411190]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2021-01-26 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?