Ideas to improve highway assignment run times outside of CUBE Cluster


Product(s):CUBE Voyager
Version(s):6.1-6.4
Area:HIGHWAY

Problem

Highway assignment is an important step in the travel demand model process and also the most time consuming step in most models. Voyager HIGHWAY assignment is an iterative process which is run towards a target convergence value (e.g., RGAP). The run times for highway assignment step is dependent on several factors as listed below

Voyager HIGHWAY assignment runs a well defined set of phases: LINKREAD, ILOOP, and ADJUST. The ILOOP and ADJUST phases are run iteratively. The print file from an HIGHWAY assignment breaks down the run times by different phases as shown below. This will give the user an idea about where most of the highway assignment run time is spent on.

CUBE Cluster helps in distributing the path building phase across multiple cores and reduce the run time. In this wiki, we will be looking at other options to speed up run time of highway assignment.

Solution

CONSOLIDATE

CONSOLIDATE is a highway assignment parameter and takes in an integer value. It specifies the minimum number of links in sequence, for link consolidation. This option reduces path building run time by removing intermediate nodes in the network, where there is only one downstream link (not an intersection). This will make a difference when networks are built from detailed GIS layers, with abundance of nodes which might not be necessary for highway assignment path building. The user can apply link consolidation by each PATHLOAD statement with the PATHLOAD CONSOLIDATE = T statement. The default value for  CONSOLIDATE parameter is 2. Below is an example:

PARAMETER COMBINE=EQUI CONSOLIDATE=2 MAXITERS=200

PATHLOAD PATH=TIME CONSOLIDATE=T VOL[1]=MW[1]
PATHLOAD PATH=DISTANCE VOL[2]=MW[2]

MULTITHREAD

MULTITHREAD is a sub-keyword of PARAMETER COMBINE, which lets you distribute ADJUST phase across multiple cores on the computer. In some highway assignments, where ADJUST phase includes several link work variable/cost/complex calculations or additional processing for outputs such as ICP files, the ADJUST phase might be time consuming. This keyword takes in an integer value which specifies the number of processor cores to use. It also has a boolean sub keyword (MEMORY), which let's the highway program know where to write the intermediate files (from individual cores) during the program run. The default for MEMORY is true, in which case the intermediate files from each individual cores will be kept in memory for faster processing. MULTITHREAD might not be very effective for all cases. Users should analyze the highway assignment print file to see if the ADJUST phase has significant run time compared to the ILOOP phase. MULTITHREAD has the below restrictions which the user should not ignore

Below is an example of MULTITHREAD

PARAMETER COMBINE=EQUI MULTITHREAD=8 MAXITERS=200
...
PROCESS PHASE=ADJUST
    IF (LI.FACTYPE < 5)
        _COT = 0.6
        _TRKCOT = 1.0
    ELSE
        _COT = 0.4
        _TRKCOT = 0.6)
    ENDIF

    LW.COST = TIME + LI.DISTANCE * _COT + LI.TOLL / {VOT} * 60
    LW.TRKCOST = TIME + LI.DISTANCE * _TRKCOT + LI.TRKTOLL / {TRKVOT} * 60
ENDPROCESS

Bucket Rounding

By default, HIGHWAY program builds paths for all OD pairs which have a value greater than zero in the trip matrix. Depending on the sparsity of your trip matrices, you might have several cells with values less than 1. Bucket rounding provides a way to adjust cell values for each zone to avoid having values less than one, and keeping the zone totals unchanged. It improves run time by reducing the number of paths being built (by zeroing out trips for OD pairs with original values less than 1). HIGHWAY program provides a matrix function ROWFIX, for bucket rounding matrices. ROWFIX has one required argument (the index of the work matrix to be fixed) and two optional arguments (column/cell to end the process and the rounding factor). It converts each cell to an integer value after adding the rounding factor and the accumulated fractional portions from the previously treated cells. With a rounding factor of 0 each cell is truncated and its fractional remainder is carried to the next cell. With a rounding factor of 0.5, each cell is rounded to the nearest integer and the difference (original – rounded) is carried to the next cell. If the process always began at zone 1, the lowest numbered zones would never get their fair share of the fractions. To eliminate this bias, the default condition is to start at the cell after the intrazonal cell and wrap around until the intrazonal cell is the last cell processed. The optional second argument specifies which cell the process is to end with. More information is available in our help. This function is applied in the ILOOP phase on the trip matrices as shown below.

PHASE=ILOOP
    MW[1]=MI.1.SOVTrips
    _x=ROWFIX (1)           ;apply rowfix for work matrix with index 1
    PATHLOAD PATH=TIME VOL[1]=MW[1]
ENDPHASE

See Also

Cluster - https://bentleysystems.service-now.com/community?id=kb_article_view&sysparm_article=KB0101964