Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When approaching a problem like this, it’s necessary to determine how a potential solution will be represented. The optimization functions you’ll see later are generic enough to work on many different types of problems, so it’s important to choose a simple representation that’s not specific to the group travel problem. A very common representation is a list of numbers. In this case, each number can represent which flight a person chooses to take, where 0 is the first flight of the day, 1 is the second, and so on. Since each person needs an outbound flight and a return flight, the length of this list is twice the number of people.
For example, the list:
[1,4,3,2,7,3,6,3,2,4,5,3]