function c=bertsekasgafni_costs(x)
k=0.1;
c(13)=10*g(x(13))+2*k*g(x(14));
c(16)=10*g(x(16))+2*k*g(x(17));
c(19)=10*g(x(19))+2*k*g(x(20));
c(22)=10*g(x(22))+2*k*g(x(23));
c(25)=10*g(x(25))+2*k*g(x(11));
c(28)=10*g(x(28))+2*k*g(x(29));
c(31)=10*g(x(31))+2*k*g(x(32));
c(34)=10*g(x(34))+2*k*g(x(35));
c(37)=10*g(x(37))+2*k*g(x(38));
c(40)=10*g(x(40))+2*k*g(x(26));
c(11)=g(x(11));
c(14)=g(x(14));
c(17)=g(x(17));
c(20)=g(x(20));
c(23)=g(x(23));
c(26)=g(x(26));
c(29)=g(x(29));
c(32)=g(x(32));
c(35)=g(x(35));
c(38)=g(x(38));
c(1)=g(x(1))+k*g(x(12));
c(3)=g(x(3))+k*g(x(15));
c(5)=g(x(5))+k*g(x(18));
c(7)=g(x(7))+k*g(x(21));
c(9)=g(x(9))+k*g(x(24));
c(2)=g(x(2))+k*g(x(27));
c(4)=g(x(4))+k*g(x(39));
c(6)=g(x(6))+k*g(x(36));
c(8)=g(x(8))+k*g(x(33));
c(10)=g(x(10))+k*g(x(30));
c(12)=g(x(12));
c(15)=g(x(15));
c(18)=g(x(18));
c(21)=g(x(21));
c(24)=g(x(24));
c(27)=g(x(27));
c(30)=g(x(30));
c(33)=g(x(33));
c(36)=g(x(36));
c(39)=g(x(39));
c=c';

function y=g(z)
y=1+z+z^2;