From 9ec1bdc8eb3bb0c72677d955e3c12ae413e12d2d Mon Sep 17 00:00:00 2001 From: ccremers Date: Tue, 17 Aug 2004 09:48:29 +0000 Subject: [PATCH] - Merged with old version of warshall.c. Some minor improvements. --- src/warshall.c | 62 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/src/warshall.c b/src/warshall.c index 3bf6ca1..6f189fc 100644 --- a/src/warshall.c +++ b/src/warshall.c @@ -16,42 +16,76 @@ graph_fill (int *graph, int nodes, int value) } } -/** - * return 1 if no cycle - * return 0 if cycle - */ -int -warshall (int *graph, int size) +//! Show a graph +void graph_display (int *graph, int nodes) { int i; - int index2 (i, j) + int index (const int i, const int j) { - return (i * size + j); + return (i * nodes + j); } i = 0; - while (i < size) + while (i < nodes) + { + int j; + j = 0; + while (j