NetOptim 1.2.6
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NetworkOracle< Graph, Mapping, Fn > Class Template Reference

Oracle for Parametric Network Problems. More...

#include <network_oracle.hpp>

Public Member Functions

 NetworkOracle (const Graph &gra, Mapping &utx, Fn h)
 Construct a new network oracle object.
 
 NetworkOracle (const NetworkOracle &)=default
 Copy constructor.
 
template<typename Num >
auto update (const Num &gamma) -> void
 Update the oracle with a new parameter value.
 
template<typename Arr >
auto assess_feas (const Arr &xval) -> std::optional< std::pair< Arr, double > >
 Assess feasibility and generate cutting plane if needed.
 
template<typename Arr >
auto operator() (const Arr &xvar) -> std::optional< std::pair< Arr, double > >
 Function call operator for cutting plane methods.
 

Detailed Description

template<typename Graph, typename Mapping, typename Fn>
requires HasKeyType<Graph>
class NetworkOracle< Graph, Mapping, Fn >

Oracle for Parametric Network Problems.

This class implements a separation oracle for network feasibility problems. It uses Howard's method for negative cycle detection to check feasibility and generate cutting planes when violations are found.

The oracle maintains:

Template Parameters
GraphType of the directed graph
MappingType of vertex potential mapping
FnType of the constraint function h, providing eval(edge, x) and grad(edge, x) methods operating on the graph's native edge data

Constructor & Destructor Documentation

◆ NetworkOracle() [1/2]

template<typename Graph , typename Mapping , typename Fn >
NetworkOracle< Graph, Mapping, Fn >::NetworkOracle ( const Graph &  gra,
Mapping &  utx,
Fn  h 
)
inline

Construct a new network oracle object.

Parameters
[in]graa directed graph (V, E) representing the network
[in,out]utxvertex potential mapping (updated during operation)
[in]hfunction for constraint evaluation and gradient computation

◆ NetworkOracle() [2/2]

template<typename Graph , typename Mapping , typename Fn >
NetworkOracle< Graph, Mapping, Fn >::NetworkOracle ( const NetworkOracle< Graph, Mapping, Fn > &  )
explicitdefault

Copy constructor.

Member Function Documentation

◆ assess_feas()

template<typename Graph , typename Mapping , typename Fn >
template<typename Arr >
auto NetworkOracle< Graph, Mapping, Fn >::assess_feas ( const Arr &  xval) -> std::optional<std::pair<Arr, double>>
inline

Assess feasibility and generate cutting plane if needed.

This is the main oracle method that checks if the current point xval is feasible with respect to the network constraints. Uses Howard's method for negative cycle detection operating on the graph's native edge data. If infeasible, returns a cutting plane (gradient and function value) that separates the infeasible point from the feasible region.

The oracle solves the feasibility problem:

\[ \text{find } x, u \quad \text{s.t.} \quad u_j - u_i \le h(\text{edge}_{ij}, x) \; \forall (i, j) \in E \]

If infeasible, it returns a cutting plane \((g, f)\) from a violating cycle \(C\):

\[ g = -\sum_{e \in C} \nabla h(e, x), \quad f = -\sum_{e \in C} h(e, x) \]

Template Parameters
ArrType of the input array/vector
Parameters
[in]xvalinput values to be assessed for feasibility
Returns
Empty if feasible, otherwise a pair containing gradient and function value

◆ operator()()

template<typename Graph , typename Mapping , typename Fn >
template<typename Arr >
auto NetworkOracle< Graph, Mapping, Fn >::operator() ( const Arr &  xvar) -> std::optional<std::pair<Arr, double>>
inline

Function call operator for cutting plane methods.

Makes the oracle callable for use with cutting plane algorithms. Forwards to the assess_feas method.

Template Parameters
ArrType of the input array/vector
Parameters
[in]xvarinput variables to be assessed
Returns
Same as assess_feas

◆ update()

template<typename Graph , typename Mapping , typename Fn >
template<typename Num >
auto NetworkOracle< Graph, Mapping, Fn >::update ( const Num &  gamma) -> void
inline

Update the oracle with a new parameter value.

Updates the internal constraint function with a new parameter value, typically used in parametric optimization where the constraints depend on a parameter that changes during the algorithm.

Parameters
[in]gammathe new parameter value (best-so-far optimal value)

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