Make a C program that can read a simple data file. The program should contain code that randomly initialize a genetic algorithm population (say population size = 100) and compute the makespans of the population. Select the best schedule according to makespans and output the schedule and its makespan.
For example suppose you have a file named text.txt that contains the following data.
3 2 //This first row indicates the number of jobs and the number of machines
0 5 1 10 //These other 3 rows represent a specific job combined by (machine-id, job-duration) pairs.
0 10 1 5
0 1 1 4
The output would be:
21 //This first line indicates the optimization criterion 2
0 0 1 1 6 //This second line is the makespan computed from the schedule
2 1 0 6 1 16 //This is the flowshop schedule combined by (job-id, start-time) pairs