opm-common
Opm::TrackOrderingTSP Class Reference

Multi-start nearest-neighbour + 2-opt TSP heuristic for TRACK ordering of well connections. More...

#include <TrackOrderingTSP.hpp>

Classes

struct  TrackCostWeights
 Cost weights controlling the TRACK edge-cost function. More...
 

Public Member Functions

 TrackOrderingTSP (int headI, int headJ)
 Construct with the well-head logical cartesian indices.
 
TrackOrderingTSPnumberOfStartPoints (std::size_t numStarts)
 Set number of start points from which to explore path creation. More...
 
std::vector< std::size_t > order (std::span< const Connection > connections) const
 Return the permutation that puts connections in TRACK order, using default-constructed TrackCostWeights. More...
 
std::vector< std::size_t > order (std::span< const Connection > connections, const TrackCostWeights &weights) const
 Return the permutation that puts connections in TRACK order, using the supplied cost weights. More...
 

Detailed Description

Multi-start nearest-neighbour + 2-opt TSP heuristic for TRACK ordering of well connections.

Member Function Documentation

◆ numberOfStartPoints()

TrackOrderingTSP & Opm::TrackOrderingTSP::numberOfStartPoints ( std::size_t  numStarts)

Set number of start points from which to explore path creation.

Parameters
[in]numStartsNumber of start points. Note that regardless of numStarts, the algorithm will always use at least one start point–the connection that's closest to the well head defined in the constructor. Furthermore, for any particular ordering problem, the algorithm will never use more start points than the number of connections passed to order().
Returns
*this.

◆ order() [1/2]

std::vector< std::size_t > Opm::TrackOrderingTSP::order ( std::span< const Connection connections) const

Return the permutation that puts connections in TRACK order, using default-constructed TrackCostWeights.

Parameters
[in]connectionsThe connections to order.
Returns
Index permutation p such that connections[p[0]] is the heel and subsequent entries follow the optimised path.

◆ order() [2/2]

std::vector< std::size_t > Opm::TrackOrderingTSP::order ( std::span< const Connection connections,
const TrackCostWeights weights 
) const

Return the permutation that puts connections in TRACK order, using the supplied cost weights.

Parameters
[in]connectionsThe connections to order.
[in]weightsCost weights for the edge-cost function.
Returns
Index permutation p such that connections[p[0]] is the heel and subsequent entries follow the optimised path.

The documentation for this class was generated from the following files: