diff --git a/.gitignore b/.gitignore index bdd61fd3062ac7fd0ba89ef9f26837eca2abea85..ab90a53f22ba1511dd9b084fadf727688b4c4d23 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,8 @@ TP1 TP2 TP3 TP4 -*.exe \ No newline at end of file +./TP1 +./TP2 +./TP3 +./TP4 +*.exe diff --git a/README.md b/README.md index e9863b46d6f0d4a37d2e313fe1ba51c90f61397e..a5aedae6a496ed5fc25f3dd7ddfa62584e066c42 100755 --- a/README.md +++ b/README.md @@ -1,42 +1,25 @@ # README -## Info: - -Feel free to use these lines as you wish. These programs load a graph in main memory as (i) a list of edges, (ii) an adjacency matrix or (iii) an adjacency list. ## To compile: -"gcc edgelist.c -O9 -o edgelist" -"gcc adjmatrix.c -O9 -o adjmatrix" -"gcc adjarray.c -O9 -o adjarray" +make +should compile on any UNIX based system -## To execute: -"./edgelist edgelist.txt" -"./adjmatrix edgelist.txt" -"./adjarray edgelist.txt" +## To execute: -"edgelist.txt" should contain the graph: one edge on each line (two unsigned long (nodes' ID) separated by a space). -The program will load the graph in main memory and then terminate. +./TP1 'path to a graph file' -## Performance: +./TP2 'path to a graph file' -- edgelist: up to 500 million edges on my laptop with 8G of RAM. Takes more or less 1.6G of RAM and 25 seconds (I have an SSD hardrive) for 100M edges. -- adjmatrix: up to 200.000 nodes on my laptop with 8G of RAM. Takes more or less 4G of RAM and 10 seconds for 100.000 nodes. -- adjlist: up to 200 million edges on my laptop with 8G of RAM: takes more or less 4G of RAM and 30 seconds for 100M edges. +./TP3 'path to a graph file' /!\ TP3 should have files "alr21--pageCategList--enwiki--20071018.txt" and file "alr21--categDAG--dirLinks--enwiki-20071018.txt" (found at : http://cfinder.org/wiki/?n=Main.Data#toc1) in the safe folder as the executable for EXERCISE 3 to work properly -adjmatrix is much less scallable than the two other programs for sparse graphs. adjmatrix uses O(n^2) memory (n^2 boolean values (note that adjmatrix uses 1 byte to encode a boolean value and not 1 bit...)), while edgelist uses O(m) (2m unsigned) and adjlist uses O(m+n) (4m+2n unsigned). +./TP4 'path to a graph file' -## Note: -If the graph is directed (and weighted) with selfloops and you want to make it undirected unweighted without selfloops, use the following linux command line. -awk '{if ($1<$2) print $1" "$2;else if ($2<$1) print $2" "$1}' net.txt | sort -n -k1,2 -u > net2.txt +graph files should contain the graph: one edge on each line (two unsigned long (nodes' ID) separated by a space). -## Initial contributors -Maximilien Danisch -September 2017 -http://bit.ly/danisch -maximilien.danisch@gmail.com diff --git a/TP1 b/TP1 deleted file mode 100755 index 122f217d6fcaf97f4b177fd9e7e99deaf2116a7f..0000000000000000000000000000000000000000 Binary files a/TP1 and /dev/null differ diff --git a/TP2 b/TP2 deleted file mode 100755 index 9099ac9b2dbc979d06b03ab0134fdc79ab8fa6fe..0000000000000000000000000000000000000000 Binary files a/TP2 and /dev/null differ diff --git a/TP3 b/TP3 deleted file mode 100755 index 98db9dcd6f1a44675eb4af731a5a225a19aa83c8..0000000000000000000000000000000000000000 Binary files a/TP3 and /dev/null differ