------------------------------------------------------------------------------------------
	                   Readme for the POSeqSel algorithm Package
	 		                version September 26, 2018
------------------------------------------------------------------------------------------

A. General information:

This package includes the C++ code of the Pareto Optimization method for Sequence Selection [1].

[1] C. Qian, C. Feng and K. Tang. Sequence Selection by Pareto Optimization. In: Proceedings of the 27th International Joint Conference on Artificial Intelligence (IJCAI'18), Stockholm, Sweden, 2018, pp. 1485-1491.


*************************************************************
POSeqSel.h: The C++ header file.
POSeqSeq.cpp: The implementation of functions declared in 'POSeqSel.h'.

In 'POSeqSel.h', we declare a class POSeqSel, which mainly contains the following functions:

private functions of the class:

vector<int> Mutation_Repetition(vector<int> s_temp): Mutation operator (which is used to generate a new solution, i.e., lines 4-8 of Algorithm 1 in the paper) for the sequence selection problem which allows repeated items in a sequence.

vector<int> Mutation_NonRepetition(vector<int> s_temp): Mutation operator for the sequence selection problem which doesn't allow repeated items in a sequence.

vector<int> DeleteOneItem(vector<int> itemString, int position): Delete the item of itemString at position.

vector<int> InsertOneItem(vector<int> itemString, int position, int item): Insert the item into itemString at position.

public functions of the class:

void SetIterationTime(long num): Set the iteration times of the POSeqSel algorithm.

void SetConstraint(int k): Set the cardinality constraint of the problem.

void SetSize(int n): Set the total number of items.

float EvaluateObjective(vector<int> itemString): Objective function evaluation which needs users to rewrite based on the specific application of sequence selection.

void SetIsRepetition(bool flag): This function is used to choose your mutation operator. If the application allows repeated items to appear in a sequence, please set it true and the mutation operator will be Mutation_Repetition. Otherwise, please set it false and the mutation operator will be Mutation_NonRepetition.

void DOPOSeqSel(): Run the POSeqSel algorithm.
*************************************************************


We give examples of using this code for two sequence selection problems (named as 'accomplishTask' and 'DAG', whose detailed introduction can be found in the paper). The former allows repeated items in a sequence while the latter does not.

If you want to apply the code to other sequence selection problems, you just need to write your own objective evaluation function. Note that you also need to select the mutation operator, which depends on whether the application allows repeated items in a sequence.

We run the code on linux server and compile them by g++ with C++11 version.

------------------------------------------------------------------------------------------

ATTN: 
- This package is free for academic usage. You can run it at your own risk. For other purposes, please contact Dr. Chao Qian (chaoqian@ustc.edu.cn).

- This package was developed by Mr. Chao Feng (chaofeng@mail.ustc.edu.cn). For any problem concerning the code, please feel free to contact him.