Packaging.

This commit is contained in:
alexgutteridge 2007-11-19 07:01:59 +00:00
parent c893cde24c
commit 1168e7a532
2 changed files with 61 additions and 10 deletions

View File

@ -11,21 +11,27 @@ ext/cIGraph_basic_properties.c
ext/cIGraph_basic_query.c
ext/cIGraph_centrality.c
ext/cIGraph_cliques.c
ext/cIGraph_community.c
ext/cIGraph_components.c
ext/cIGraph_connectivity.c
ext/cIGraph_dijkstra.c
ext/cIGraph_direction.c
ext/cIGraph_error_handlers.c
ext/cIGraph_file.c
ext/cIGraph_generators_deterministic.c
ext/cIGraph_generators_random.c
ext/cIGraph_independent_vertex_sets.c
ext/cIGraph_isomorphism.c
ext/cIGraph_iterators.c
ext/cIGraph_kcores.c
ext/cIGraph_layout.c
ext/cIGraph_layout3d.c
ext/cIGraph_matrix.c
ext/cIGraph_min_cuts.c
ext/cIGraph_motif.c
ext/cIGraph_operators.c
ext/cIGraph_other_ops.c
ext/cIGraph_randomisation.c
ext/cIGraph_selectors.c
ext/cIGraph_shortest_paths.c
ext/cIGraph_spanning.c
@ -42,7 +48,9 @@ test/tc_basic_properties.rb
test/tc_basic_query.rb
test/tc_centrality.rb
test/tc_cliques.rb
test/tc_community.rb
test/tc_components.rb
test/tc_connectivity.rb
test/tc_copy.rb
test/tc_cores.rb
test/tc_create.rb
@ -50,14 +58,18 @@ test/tc_dijkstra.rb
test/tc_directedness.rb
test/tc_error_handling.rb
test/tc_file_read_write.rb
test/tc_generators_deterministic.rb
test/tc_generators_random.rb
test/tc_independent_vertex_sets.rb
test/tc_isomorphic.rb
test/tc_iterators.rb
test/tc_layout.rb
test/tc_layout3d.rb
test/tc_matrix.rb
test/tc_mincuts.rb
test/tc_motif.rb
test/tc_other_ops.rb
test/tc_randomisation.rb
test/tc_selectors.rb
test/tc_shortest_paths.rb
test/tc_spanning.rb
@ -67,4 +79,3 @@ test/tc_topological_sort.rb
test/tc_transitivity.rb
test/tc_vertex_neighbourhood.rb
test/test_all.rb
test/test_draw.rb

View File

@ -16,22 +16,62 @@ IGraph is only available as a gem. The installation requires the location of you
== Documentation
Graph objects are represented in the IGraph class. See the IGraph class documentation for a list of available methods available to build and query graph objects. Any object can be used as a vertex and any edge can be annotated with any kind of object.
Graph objects are represented in the IGraph class. See the IGraph class documentation for a list of available methods available to build and query graph objects. The graph generators will use simple Integers as the vertices, but you can use any object as a vertex and edges can also be annotated with any kind of object.
Note that many functions require 'mode' constants to tell igraph how you want certain calculations to be made. The constants are listed under the IGraph documentation and should also be made explicit in each methods documentation.
Here is a very quick and simple example:
Here are three examples which translate the C tutorial programs from the igraph documentation (http://cneurocvs.rmki.kfki.hu/igraph/doc/html/igraph-tutorial.html).
require 'igraph'
= 1.
#Create an empty directed graph
graph = IGraph.new([],true)
require 'igraph'
#Add two edges (unannotated)
graph.add_edges([1,2,3,4])
g = IGraph::GenerateRandom.erdos_renyi_game(IGraph::ERDOS_RENYI_GNP,
1000, 5.0/1000,
false, false)
#Count the number of vertices
graph.vcount # returns 4
d = g.diameter(false,true).size-1
puts "Diameter of a random graph with average degree 5: #{d}"
= 2.
require 'igraph'
graph = IGraph::Generate.lattice([30,30],false,false,true)
puts "Average path (lattice): #{graph.average_path_length(false,true)}"
graph.add_edges(Array.new(20){rand(graph.vcount)})
puts "Average path (randomised): #{graph.average_path_length(false,true)}"
= 3.
require 'igraph'
edges = [
0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8,
0, 10, 0,11, 0,12, 0,13, 0,17, 0,19, 0,21, 0,31,
1, 2, 1, 3, 1, 7, 1,13, 1,17, 1,19, 1,21, 1,30,
2, 3, 2, 7, 2,27, 2,28, 2,32, 2, 9, 2, 8, 2,13,
3, 7, 3,12, 3,13, 4, 6, 4,10, 5, 6, 5,10, 5,16,
6, 16, 8,32, 8,32, 8,33, 9,33,13,33,14,32,14,33,
15,32,15,33,18,32,18,33,19,33,20,32,20,33,
22,32,22,33,23,25,23,27,23,32,23,33,23,29,
24,25,24,27,24,31,25,31,26,29,26,33,27,33,
28,31,28,33,29,32,29,33,30,32,30,33,31,32,31,33,
32,33
]
g = IGraph.new(edges,false)
vs = g.vertices
max = vs.zip(g.degree(vs,IGraph::ALL,true)).max{|a,b| a[1] <=> b[1]}
puts "Maximum degree is #{sprintf("%10i",max[1])}, vertex #{max[0]}."
max = vs.zip(g.closeness(vs,IGraph::ALL)).max{|a,b| a[1] <=> b[1]}
puts "Maximum closeness is #{sprintf("%10f",max[1])}, vertex #{max[0]}."
max = vs.zip(g.betweenness(vs,IGraph::ALL)).max{|a,b| a[1] <=> b[1]}
puts "Maximum betweenness is #{sprintf("%10f",max[1])}, vertex #{max[0]}."
== License