Mean-Risk Traffic Assignment under the Continuously Distributed Risk-Aversion Factor
=====================================================================================

This supplementary material contains the source code and network data used in the paper "Mean-Risk Traffic Assignment under the Continuously Distributed Risk-Aversion Factor".

File Structure
--------------

The archive is organized as follows:

- Solution folder
  - AlgSolution.sln: The top-level solution file that stores information about the projects, dependencies, build configurations, and other settings.

- DllProj folder (natepNet.vcxproj) 
  - This folder contains the DLL project with functionality resources related to the CG-GP algorithm.

    - NaTEP.h: Declaration of classes SLINK, SNODE, SPATH, SORIGIN, SDest, etc.

    - MeanRisk.h: Declaration of classes MR_NET, RAF_DIST, MR_CLASS

    - CMRTA.cpp: Function definitions that are declared in NaTEP.h and MeanRisk.h. Here are some examples for several important functions related to CG-GP algorithm. 

       - MR_NET::BuildTAPASNet(), This function aims to build the transportation network based on the network data.

       - MR_NET::SolveContinuousMRTA(): Call the CG-GP algorithm.

       - MR_NET::ColumnGeneration(), This function aims to find potential efficient paths with two steps:

          1) MR_NET::LabelSettingBSPTree(SORIGIN* Org), Applying the labeling mean-variance bi-objective algorithm given origin node Org.

          2) MR_NET::IdentifyFrontier(SDest* dest), Identifying the support efficient paths that lie on the Pareto frontier.

       - MR_NET::RMP_Equilibration(), This function aims to solve the restricted master problem.

       - MR_NET::ColumnDroping(), This function aims to remove unused paths after the RMP is solved.

- ExeDriver folder (CMRTADriver.vcxproj)
  - This folder contains the executable project with the entry point for executing the algorithm. 

  - Run different networks through Main function, including:

    - Section 6.1 for the Braess network: Net_Braess(): 

    - Section 6.2 for four real-world networks:Net_SF(), Net_Anaheim(), Net_BarNet(), Net_CsNet().

- Networks folder
  - The network data files are located in the "Networks" folder. You can modify the code to load and process the desired network data. 

  - This folder contains two types of data files for five above networks:
    
    - net.dat: It include the information of network links.

    - trp.dat: It include the information of travel trips between OD pairs.


Dependencies
------------

The following external libraries are included in the root directory:

1. "bin/x64" folder: All required .dll files.

2. "lib/x64" folder: All required .lb files.

3. "include" folder: All required external source files.


Getting Started
---------------

1. Open the `AlgSolution.sln` file in Visual Studio 2022.

2. Build the solution to compile the projects.

3. Run the executable project (`CMRTADriver.exe`) to execute the algorithm.

4. Output the convergence information by [network name]-[ex/en]_[con]-ext[lowerbound,upperbound].conv

Note: Detailed instructions on how to use the code and configure the algorithm parameters (if necessary) are provided in the paper and the source code comments.




