Algorithm The weighted average and cosine algorithm (w.a.co)

input: The number of decision variables (n), the number of constraints (m), the coefficient matrix of the problem (A), the vector of the right-hand side coefficients (b), the vector of the objective coefficients (c), two random integer numbers r 1 : n < r 1 m , r 2 : n < r 2 m .

output: The percentage of binding constraints after the reduction that are identical to the binding ones in the original problem (p.bind), the total used constraints (used), the constraints of the weighted average method (m1), the constraints of the cosine similarity method (m2), the common constraints ( m 1 m 2 ).

(Initialization) Compute:

λ i , i = 1 , 2 , , m , using (3)

1 / λ i 2 , for i = 1 , 2 , , m

cos θ i , i = 1 , 2 , , m , using (4)

Set r n d 1 = { increasingorder ( 1 / λ i 2 ) } = rank ( 1 / λ i 2 ) , i = 1 , 2 , , m

Set r n d 2 = { increasingorder ( cos θ i ) } = rank ( cos θ i ) , i = 1 , 2 , , m

(General loop)

While r 1 : n < r 1 m , r 2 : n < r 2 m , do

Select: m1 = theconstraints of rnd1 set that their rank is r 1

Select: m2 = the constraints of rnd2 set that their rank is r 2

If m 1 m 2 = , then

use the subset m 1 m 2

If the problem (1) is feasible, then

solve the problem (1) using an LP method - STOP

else

select r 1 _ n e w < r 1 and r 2 _ n e w < r 2

solve the problem (1) using an LP method

end second if

else

if m 1 m 2 = & m 1 + m 2 = m , then

solve the problem (1) using an LP method - STOP

end first if

Print

p.bind, used, m1, m2, common

end while