"""
This python file calculates and presents sub-optimality gaps for Examples 1 -- 3
Reproduce results in Table 1 in the appendix
"""

import sys
sys.path.append('/Your Path/Data_Code/Methods')
import Sub_Gap as SG


# Example 1 Suboptimality gap
pos = [1,1/2]
v = [1/4,2/5,4/5]
r = [4/5,3/4,1/2]
_, Subgap_Ex1 = SG.Sub_Gap(pos,v,r,2)
print("Suboptimality gap for Example 1:", Subgap_Ex1)

# Example 2 Suboptimality gap
pos = [1,1/2,1/3]
v = [1,4/5,3/5,2/5,1/5]
r = [2/5,1/5,4/5,3/5,1]
_, Subgap_Ex2 = SG.Sub_Gap(pos,v,r,2)
print("Suboptimality gap for Example 2:", Subgap_Ex2)

# Example 3 Suboptimality gap
pos = [1,1/2,1/3,1/4,1/5]
v = [(10-i)/10 for i in range(10)]
r = [0.3, 0.2, 0.7, 0.4, 0.5, 0.6, 0.1, 0.9, 1.0, 0.8]
_, Subgap_Ex3 = SG.Sub_Gap(pos,v,r,2)
print("Suboptimality gap for Example 3:", Subgap_Ex3)