+ Reply to Thread
Results 1 to 2 of 2

Analysing voting preference - using VBA?

  1. #1
    Registered User
    Join Date
    07-23-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    2

    Analysing voting preference - using VBA?

    Hi

    I've been trying to find a way to write a VBA program to calculate the optimal solution for allocate projects to a number of different people based on their preferences, but I have had no luck.

    For example, I have ten projects that need to be allocated to ten people. Each person states their 1st, 2nd and 3rd preference which are then turned into scores (1st=30, 2nd=20, 3rd=10).

    The objective is to allocate the projects to people in such a way that maximises the overall score. So, for example, if everyone was allocated their 1st preference the total score would be 300 (the maximum possible).

    What I have been trying to create is a VBA program that could determine the optimal allocation of projects based on preferences, generating the highest total score, which ensured each person was allocated only one project each.

    Any ideas would be most welcome!

    Thanks
    Matt

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Analysing voting preference - using VBA?

    I've done something similar in the past, but for a many-to-many assignment instead of one-to-one.

    Given 30 employees and 50 tasks, assign a team of 15 people to each task. Each employee rates each task as 3/2/1 (reallwanto/ratherbeboiledinoil). So each employee was assigned 25 of the 50 tasks.

    Assignment Round: Starting with the most senior employee, identify his highest-preference tasks among those remaining (i.e., for tasks that are not yet fully staffed). For each task at that level, identify the one that has the lowest preference among all other employees, and assign him that one. Proceed in round-robin fashion until all tasks are assigned.

    Swap Round: For every employee and every assignment, compare preferences. If swapping the assignment made either employee 'happier' without decreasing the happiness of the other, swap. Repeat until no swaps occur.

    The approach worked very well for me, based on the 'happiness quotient' -- a measure of what people were assigned to compared to their optimal assignment.

    The rigorous solution for your 1:1 problem is called maximum weighted bipartite matching in graph theory. Lots of literature if you Google.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1