Need C# Genetic algorithm to solve scheduling problem

Posted on 2011-04-21
Last Modified: 2012-06-22
I'm looking for C# code to solve a scheduling problem were 100 people have signed up for 4 classes that only have 25 seats.  How to fill the classes bases on first come first serve.
Question by:JElster
    LVL 37

    Expert Comment

    Umm, what's the issue? They can all go into a class. Is the issue that they all want the same class? If it's first come first served, then you just assign them in the order they arrived to whichever class they want. I'm not seeing where the genetic algorithm is needed.
    For a genetic algorithm, you need to have something to optimize. What are you optimizing here?
    LVL 38

    Accepted Solution

    If it's in SQL you can pull the top 25 by time. Repeat.
    LVL 1

    Author Comment

    Thanks... What if... I have 4 classes , 100 Students... and each student must take 2 of the classes. How do I assign the students.. how many students can I have in each class.  I'm trying to optimize the number of students in a class
    LVL 84

    Expert Comment

    If you have 4 classes , 100 Students... and each student must take 2 of the classes.
    then at least one class must have at least 50 students.
    if classes only have 25 seats, at least 25 of them must stand.
    If you are trying to minimize the number of students standing,
    then you only need to insure that all seats are filled.
    LVL 26

    Expert Comment

    What is "optimize"?

    Assumptions seem to include that all four classes are given once and that the four run concurrently... otherwise there is no known direction to go.

    But if students "must" take two classes, then it doesn't fit with concurrent classes, and maybe not single sessions.

    And if classes may be presented more than once or if they are presented at different times, the whole problem might be moot. All students might easily get all four classes.

    Too much is either unknown or contradictory.


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Article by: Nadia
    Linear search (searching each index in an array one by one) works almost everywhere but it is not optimal in many cases. Let's assume, we have a book which has 42949672960 pages. We also have a table of contents. Now we want to read the content on p…
    Have you ever thought of installing a power system that generates solar electricity to power your house? Some may say yes, while others may tell me no. But have you noticed that people around you are now considering installing such systems in their …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now