Results 1 to 2 of 2

Math Help - karmarkar s algorithm - linear program

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    1

    Post karmarkar s algorithm - linear program

    I have been trying to implement karmarkars algorithm to solve a linear program using matlab.

    My program doesn converge to a solution even after letting it run forever!
    considering tht my current problem has only 7 variables i think something is wrong with my code.

    i would be grateful if some1 could point out defects if you find any

    please refer images for algorithm used, I was not able to type out the whole thing

    thanks a ton!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Matlab code:

    clc
    clear

    c=[-15;-6;-8;-1;0;0;0];

    a=[10 05 25 03 01 00 00 ;
    12 04 12 01 00 01 00 ;
    07 00 00 01 00 00 01 ;];

    b=[50;48;35];

    N=size(a);
    m=N(1)+1;
    n=N(2)+3;
    beta1=30;
    c1=(-n/beta1)*b;
    B=[a zeros(N(1),1) c1 -c1-a*ones(N(2),1); zeros(1,N(2)) 0 n 0];

    d=[beta1*c' 0 0 100];

    zo=(1/n)*ones(n,1);
    z=zo;e=10;
    dtr=norm(d)*sqrt(n*(n-1));
    it=0;
    while e>0.001
    dz=diag(z);
    p=[B*dz;ones(1,n)];
    y=zo-(0.25/dtr)*((eye(n)-p'*inv(p*p')*p)*dz*d');
    zn=zeros(n,1);
    ndtr=0;
    for i=1:n
    ndtr=ndtr+(z(i)*y(i));
    end

    for i=1:n
    zn(i)=z(i)*y(i)/ndtr;
    end

    if mod(it,100000)==0
    y1=0;
    end
    it=it+1;
    z=zn;
    e=norm(d*z)
    end
    Attached Thumbnails Attached Thumbnails karmarkar s algorithm - linear program-1.jpg   karmarkar s algorithm - linear program-2.jpg   karmarkar s algorithm - linear program-3.jpg   karmarkar s algorithm - linear program-4.jpg  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Mar 2010
    Posts
    1

    Thumbs up KARKARKA in matlab

    Hi dear
    sure I can help you.
    I have some kind of researches in KARMARKA algoritm.
    send me the complete matlab codes that you wrote till I rewrite it for you.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Linear program with higher order non-linear constraints.
    Posted in the Advanced Math Topics Forum
    Replies: 2
    Last Post: September 12th 2010, 02:36 AM
  2. Linear Program constraint formulation
    Posted in the Advanced Applied Math Forum
    Replies: 0
    Last Post: March 11th 2010, 02:29 AM
  3. Linear program
    Posted in the Advanced Algebra Forum
    Replies: 0
    Last Post: January 20th 2010, 07:57 PM
  4. complexity of this algorithm in my program
    Posted in the Math Software Forum
    Replies: 1
    Last Post: September 3rd 2009, 01:36 PM
  5. Linear Program help
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: April 21st 2007, 06:54 AM

Search Tags


/mathhelpforum @mathhelpforum