\(\(\(
\)\(
\)\( (*\ 
Program\ na\ testovanie\ vypoctovej\ zlozitosti\ metod\ linearneho\ programovania\ 
*) \)\(
\)\(
\)\(\(casySimplex = {};\)

    \(casyIntpo = {};\)


    \(nkrok = 30;\)


    \(For[n = 10, n ≤ 300, \ 
        1, 
{

k = 
            n; 

c = 
            Table[1. , \ {i, 1, n}]; 

A = 
            Table[Table[Abs[Sin[i*j]], \ {j, 1, n}], \ {i, 1, 
                k}]; 

b = 
            Table[1. , \ {i, 1, 
                k}]; 

Print["Rozmer ulohy n = ", \ 
            n]; 

cas = \(Timing[
                vystupSimplex = 
                  LinearProgramming[c, A, 
                    b, "Method" -> {"RevisedSimplex"}]]\)[\([1]\)]; 
Print["Simplexova metoda"]; 
Print["Hodnota ucelovej funkcie = ", \ 
            c . vystupSimplex]; 
Print["Spotrebovany cas ", \ cas]; 
casySimplex = 
            Join[casySimplex, \ {{n, cas /. Second -> 1}}]; 


          Print[]; 

cas = \(Timing[
                vystupIntpo = 
                  LinearProgramming[c, A, 
                    b, "Method" -> {"InteriorPoint"}]]\)[\([1]\)]; 
Print["Metoda vnutorneho bodu"]; 
Print["Hodnota ucelovej funkcie = ", \ c . vystupIntpo]; 

          Print["Spotrebovany cas ", \ 
            cas]; 
casyIntpo = 
            Join[casyIntpo, \ {{n, \ 
                  cas /. Second -> 
                      1}}]; 



          Print["------------------------"]; 

n = n + nkrok;
}];\)\)\)\)

\(\($TextStyle = {FontFamily -> "Helvetica", 
          FontSize -> 12, 
          FontWeight -> "Bold"};\)

\)
rozsah = 
        Max[
Max[
            Table[casySimplex[[i]][[2]],  {i, 1, 
                Length[casySimplex]}]], 
Max[
            Table[casyIntpo[[i]][[2]],  {i, 1, 
                Length[casyIntpo]}]]
];

\(\(graf1 = 
        ListPlot[
          casySimplex, \ 
PlotJoined -> 
            True, 
Frame -> 
            True, 
PlotStyle -> {RGBColor[0.8, 0.1, 
                0.3], Thickness[
                0.01]}, 
FrameLabel -> {"n", \ "T", "Simplexova   metoda", None}, 
Axes -> 
            None, 
PlotRange -> {0. , \ 
              rozsah}, 
ImageSize -> 
            6*72];\)
\)
\(\(graf2 = 
        ListPlot[
          casyIntpo, \ 
PlotJoined -> 
            True, 
Frame -> 
            True, 
PlotStyle -> {RGBColor[0.1, 0.1, 
                0.8], Thickness[
                0.01]}, 
FrameLabel -> {"n", \ "T", "Interior   point   metoda", 
              None}, 
Axes -> 
            None, 
PlotRange -> {0. , \ 
              rozsah}, 
ImageSize -> 
            6*72];\)
\)
\(\(graf3 = 
        ListPlot[
          casyIntpo, \ 
PlotJoined -> 
            True, 
Frame -> 
            True, 
PlotStyle -> {RGBColor[0.1, 0.1, 
                0.8], Thickness[
                0.01]}, 
FrameLabel -> {"n", \ "T", "Porovnanie  metod", None}, 
Axes -> 
            None, 
PlotRange -> {0. , \ 
              rozsah}, 
ImageSize -> 6*72, \ 
          DisplayFunction -> 
            Identity];\)
\)
Show[graf3, graf1,  
        DisplayFunction -> $DisplayFunction];