Simple Program: Algorithm for Building Groups

Budget $30 - $250 USD
Bids 16
Average Bid $118

I need a program which will create unique groups of elements subject to certain criteria. I need to be able to vary the inputs and run the program in a browser or Excel. If absolutely necessary I could use Matlab, Stata, or Access to run it too. (If you have another idea please let me know.) Program does not need to look too pretty but should be simple to use. It doesn't need to be very efficient in terms of speed either, if it takes a few seconds to run that will be fine. I can visualize how the algorithm might work but I don't have programming skills. Hopefully someone can program it up pretty quickly.

Here is the problem:

I have two groups (of people) A and B. Group A has N_a people and group B has N_b people (i.e. N = N_a + N_b). I want to randomly build G distinct groups of people, all of size N_g in round R=1. However, these groups must meet certain criteria: some groups will need n people from group A and m people from group B while other groups will need n' people from group A and m' people from group B, and so on. (Example: If I have 20 (N_a) people in A and 20 (N_b) people in B then I want to make 8 groups (G) of 5 people (N_g). I want the group compositions to be 1A/4B, 1A/4B, 2A/3B, 2A/3B, 3A/2B, 3A/2B, 4A/1B, 4A/1B. I would want to specify the group compositions, the number in each group (N_g), the number of groups (G).)

After round R=1, for round R=2, I want to then randomly assign everyone to a different group subject to the specified group compositions (same compositions for all rounds - these only need to be specified once). But, no one can be in a group with the the same person as before. (So, we randomly create 8 groups of 5 with the same specified group compositions but no two people should be in the same group with each other in both R=1 and R=-2).

Finally, in R=3 we do the same thing. Randomly make G groups all of size N_g but no one can be in a group with someone they were in a group with in R=1 or R=2.

I want the program to be flexible enough to specify any value of R.

I realize that there is a set of (N_a,N_b) pairs that will work once you specify R, G, N_g, and the compositions for each group. In each round some people will of course not be in one of the groups.

So, I want the program to deliver the following:

1. Given R, G, N_g, and the compositions A/B for each group, I want to be given a list of all (N_a,N_b) pairs for which it is possible to complete all the groupings as specified. This is of course for the minimum necessary N (call it minN) since an infinite number of pairs exists. Also you could include the pairings for minN + 1. (EX: For the example above, I know from brute force that 20A/23B will allow me to make 8 unique groups in all 3 rounds given the compositions 1A/4B, 1A/4B, 2A/3B, 2A/3B, 3A/2B, 3A/2B, 4A/1B, 4A/1B. List all the other pairings that will work, such as 21A/22B, i guess. Or, maybe you only need minN=42. Then list all the pairs that will work such that N_a+N_b = 42. Also then list all the pairs for minN+_1 = 43.).

2. By specifying R, G, N_g,the compositions for A/B for each group and (N_a,N_b), I want a list of randomly generated groups. I imagine it would show for each R the elements of A and B in each group. Important: In the event that the (N_a,N_b) pair I input cannot completely satisfy the constraints put in, the program needs to ask which group(s) of G to not fulfill. The output should then list the elements of A and B not assigned to a group as well. (EX: if I only had 20A/21B, I don't think it would be possible to create all the unique groups according to the combinations. So the program should ask which of the 8 groups to not fill. It would then still assign people to the remaining 7 groups. If it can only satisfy 6 groups then it should ask for 2 to be dropped. Elements not assigned to one of the 7 complete groups should also be listed. They can be in the "Sit Out" group.)

3. The output should also list for each element/person of A or B which group it is assigned to in each round. (EX: Person 5: Group 1 (R=1); Group 4 (R=2); Group 1 (R=3)). I don't care how, but every element needs a unique identifier. I must be able to tell whether an element came from A or B. So, giving elements in A odd number and elements in B even numbers will work. Or, A1, A2, etc. and B1, B2, etc. Groups should be uniquely labeled too by their round (R) and group within that round.

4. The output files need to be something I can print - a txt file or PDF, etc.

Post a Project Like This

Looking to make some money?

  • Set your budget and the time frame
  • Outline your proposal
  • Get paid for your work

Bids on this Project

  • sankalp7000 Profile Picture


    Delhi,  India

    Java, JSP, XML, and Data Processing

  • olevitan Profile Picture


    Cedar Grove,  United States

    Visual Basic, .NET, Copywriting, and SEO

  • vano200571 Profile Picture


    Chisinau,  Moldova, Republic of

    PHP, ASP, C Programming, and Java

  • KirillVG Profile Picture


    Moscow,  Russian Federation

    Visual Basic, Data Processing, Excel, and SQL

  • trupti Profile Picture


    Mumbai,  India

    Over 18+ years of Solid Professional experience in developing Desktop, Client/Server, Component Development, Mobile Development, Database Development, and distributed applications as well. Extensive exposure in object oriented programming (OOPS). I provide development solutions and services for Mobile , Desktop, Client-Server/Remote and Database Related applications. I also provide Data Entry, Data Collection, Data Mining, Data Warehouse, and related services and solutions. Sun Certified Java Programmer (SCJP). I develop applications for clients as per their needs and requirements. I Believe in providing Quality Work with best solutions and Timely Delivery with Client's Complete Satisfaction. From 2000 till date, I work as a Freelancer Software Developer/Consultant under the name of Terry Consulting.

    Java, XML, Visual Basic, and .NET

  • refractocd Profile Picture
  • cnut17 Profile Picture


    Haguenau,  France

    Employment History Software developer | PERINFO January 2013 - November 2015 Maintenance and building new features on a commercial software designed to manage bus and taxies operators as well as car rent agencies. Delphi / Oracle, within a team of 10 developers. Business Development Manager | Alsace Techniques Etiquetage January 2007 - October 2011 This company prints custom adhesive labels. I maintained a home made ERP. Languages : Delphi, Windev, C# Developer | Authentis March 2004 - July 2005 For a real estates agency, I developped a database to handle a call center. MS-Access / SQL Server / Visual Basic Developer | Sonoco Paper France May 1998 - July 2003 Year 2000 project changeover to the euro currency Migration from a self-made ERP to Navision Fields technician | Dow Chemical January 1996 - September 1997 User support with a ticketing system.

    PHP, C Programming, Visual Basic, and Translation

  • Matlabcoder Profile Picture


    zaragoza,  Spain

    TRW Automotive, Actuation department AHB and ECA3 projects. Control design and simulation model design of advanced breaking systems (Stop&Go, Safety Systems, Wake up …). Test rig and vehicle software implementation including Can signals of the vehicle (Volkswagen Touareg) using tools Matlab / Simulink / RTWorkshorp / TargetLink / dSpace. Test rig and vehicle test inside TRW circuit.

    C Programming, Matlab & Mathematica, CAD/CAM, and Statistics

  • srinichal Profile Picture


    hyderabad,  India

    Perfection and dedication are the way we deal with projects on freelancer. There have been many clients all over the world that are satisfied with the solutions provided.All types of automation works along with web based solutions are our expertise. Looking to provide solutions in the Mobile markets as well. Some of the automation tools are listed in portfolio and here as well: * AutoBidder tool for Madbid like sites * Automation tools For all emails and social Bookmark sites * Social Bookmarking tools * Facebook Likes Automation * Webbased Versions of tools tailored to custom needs * Desktop apps tailored to customer needs * Proxy tools tailored to your requirements. A dedicated team that can literally deliver any project solution with high expertise. Please don't hesitate to contact us via freelancer. Satisfaction guaranteed solutions delivered all over the world. The Skill Set ranges from C# to PHP, Iphone to Andriod. We can deliver almost any solutions for your needs. We can also take up any type of work based on web design to desktop or mobile in the broad spectrum as we always strive to learn and perfect.

    PHP, Perl, Java, and JSP

  • expertMan Profile Picture


    Dhaka,  Bangladesh

    Skill Summary ______________ Work experience 6 years. Mobile Application: ---------------- Web application for mobile, android application Desktop Application: ------------------- Design and develop desktop base application using programming language VB6, VB.NET,C# with object oriented concept. Have experiences with backend database Oracle , MsAccess, MsSQL etc. Reporting: crystal report, VB report, Access report etc. Webbased Application: ------------------- Coding and design website/ web application in LAMP environment as well at windows environment. Programming with w3c standard. Have ability to start from scratch Have ability to classic coding and OPP programming both Preferable Programming environment is fontend: PHP,ASP, ASP.NET, Javascript, vbscript etc. backend: mysql , postgreSQL, MsAccess, MsSQL etc. other design issue: Html,CSS etc. Have experience work with XSL, XHTML, XML, DTD, XSLT, SVG DBA Experiences: ------------------- Have Experience work with various type of RDBMS. Relational Database Design, Analysis, indexing etc. Have Experience work with million records of big database handle including Export, import, migration , etc. Customization: ------------------- Oscommerce, ZenCart , xtCommerce, Wordpress etc. Office Application: ------------------- Have experience in excel programming, VBA application, Server side VBS with schedule job, MsAccess Application, excel , VBA programming with CSV/TSV etc. Design Tools: ------------------- Dreamwever, Photoshop , coreldrow etc. API ------------------- Facebook, youtube, Google map etc. Framework ------------------- Zend Framework, Cakephp etc. Google Related: ------------------- froogle Data Feed, Google Map API, Webmaster Tools: Sitemap, Google analytic, AdWords, Adsense etc. Linux Server Related: ------------------- Capable to installation and configuration various type of software/package for example PHP, Mysql, Apache, Oracle, FTP, FtpPro, DNS, DHCP, LDAP , samba-ladap , Mail(Sendmail,Postfix+Dovecot), Webmail, iptables, Cron / Scheduler job etc. Shell Script, C/C++ programming in Linux Environment. Real Basic for OS independent desktop application. LDAP, LDAP-SAMBA unified authentication system with roaming user profile. Some Advanced Course ------------------ Advance Database System , Software Quality Assurance, cisco Academic Course, Advance Networking and Security Management, Neural Network etc.

    PHP, ASP, Java, and Javascript