with(FGb); with(EXAGON); vverb := 1; ## nonreached1 vars:=[x,y,z]; f:=(x*y-1)^2+y^2+z^2+42; F:=[z]; st := time(): Optimize(f, F, vars, verbose = vverb); time()-st; ## nonreached2 vars:=[x,y,z]; f := (x*y-1)^2+x^2+z^2*g+g^3*(x+1) + 42; g := x^2-x*y+z*x*y+y+3: F:=[g]; st := time(): Optimize(f, F, vars, verbose = vverb); time()-st; ## isolated vars:=[x,y]; f := (x^2+y^2-2)*(x^2+y^2); F := [(x^2+y^2-1)*(x-3)]; st := time(): Optimize(f, F, vars, verbose = vverb); time()-st; ## reachedasympt vars:=[x,y,z]; f := (1/10*(x*y-1)^4 + x^6)*y^6 + 1/124*z^2 + 42; F := [z]; st := time(): Optimize(f, F, vars, verbose = vverb); time()-st; ## GGSZ2012 vars:=[x,y]; f := (x+1)^2+y^2; F := [x^3 - y^2]; st := time(): Optimize(f, F, vars, verbose = vverb); time()-st; ## Nie 2010 vars:=[x,y,z]; f := x^6+y^6+z^6+3*x^2*y^2*z^2-x^2*(y^4+z^4)-y^2*(z^4+x^4)-z^2*(x^4+y^4); F := [x + y + z - 1]; st := time(): Optimize(f, F, vars, verbose = vverb); time()-st; ## laxlax vars := [x1, x2, x3, x4]; f := x1*x2*x3*x4-x1*(x2-x1)*(x3-x1)*(x4-x1)-x2*(x1-x2)*(x3-x2)*(x4-x2)-x3*(x1-x3)*(x2-x3)*(x4-x3)-x4*(x1-x4)*(x2-x4)*(x3-x4); F:=[x1, x2-x3, x3-x4]; st := time(): Optimize(f, F, vars, verbose = vverb); time()-st; ## MaxCutPolynomial: computes the polynomial corresponding with the MaxCut problem # input: # - L: list of weights of the maxcut problem (L = [w_11, w_12,..., w_1n, w_23, w_24,...] # - n: the number of vertices # - vars: list of n variables # output: # - the polynomial defined as the sum of w_ij(1 - vars_i*vars_j) for i