VaSa | 21 May 2013 13:37
Picon

What formula is used for std in vertex_average and edge_average?

I am curious what is being used to calculate the standard deviation of the
average in gt.vertex_average and gt.edge_average

>>> t2=gt.Graph()
>>> t2.add_vertex(2)
>>> t2.add_edge(t2.vertex(0), t2.vertex(1))
>>> gt.vertex_average(t2, "in")
(0.5, 0.35355339059327373)

Now, shouldn't std be σ(n)=sqrt(((0-0.5)^2+(1-0.5)^2)/2)=0.5 ?
also q(n-1)=sqrt((0.5^2+0.5^2)/(2-1))~=0.70710

0.3535 is sqrt(2)/4 which happens to be σ(n-1)/2, so it seems there is some
relation to that.

A little bigger graph.
>>> t3=gt.Graph()
>>> t3.add_vertex(5)
>>> t3.add_edge(t3.vertex(0), t3.vertex(1))
>>> gt.vertex_average(t3, "in")
(0.2, 0.17888543819998318)

Now, we should have 0,1,0,0,0 series for vertex incoming degree.
So Windows calc gives σ(n)=0.4 and σ(n-1)~=0.44721, so where does 0.1788854
come from ?

Reason, I am asking because, I have a large graph, where the average looks
quite alright but the std makes no sense, as going by the histogram, degree
values are quite a bit more distributed than the std would indicate.

(Continue reading)

Eric Jonas | 20 May 2013 19:42

Building on OSX 10.8 with brew, Anaconda Python distribution

Hey guys! I'm trying to build graph-tool and I'm using:
OSX 10.8
brew
The latest Anaconda python distribution from Continuum.

When building the blockmodel I'm getting the following error:

graph_blockmodel.hh:910: error: no matching function for call to
'get(const boost::tuples::tuple<boost::UndirectedAdaptor<boost::filtered_graph<boost::adj_list<long
unsigned int>, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned
char, boost::adj_edge_index_property_map<long unsigned int> > >,
graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned
char, boost::typed_identity_property_map<long unsigned int> > > >
>::EdgeDescriptor, bool, long unsigned int, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type>&)'

The (now complex) configure command I'm using is:
LDFLAGS=-L/usr/local/opt/boost149/lib
CPPFLAGS="-I/usr/local/opt/boost149/include
-I/usr/local/include/sparsehash" CC=gcc-4.7
PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ./configure
--prefix=`python2.7-config --prefix`

which ultimately gives the output in the gist at :
https://gist.github.com/ericmjonas/5613858

I've tried explicitly using boost 1.49 and boost 1.52, as well as
GCC-4.7 (and clang) and still always get this error. I'm sort of out
(Continue reading)

piwonski.kris | 17 May 2013 12:19
Picon

importing graph_tool

Hi guys,


when I import graph_tool I get an error.
It complains  graph filtering was disabled at compile time.
Well, I can't set it enable because for some reason compiling with flag enabled drains out my memory.
I have 4GB RAM and I am using Arch. I get package from AUR repository and made makepkg on it(I had to modify it slightly to get rid of openmp and graph-filtering).



My stack trace from ipython:


In [1]: from graph_tool.all import *
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-1-100bbe2bc9d9> in <module>()
----> 1 from graph_tool.all import *

/usr/lib/python2.7/site-packages/graph_tool/__init__.py in <module>()
   2010                     e.__class__.__doc__ = _edge_doc
   2011 
-> 2012 init_edge_classes()
   2013 
   2014 # some shenanigans to make it seem there is only a single edge class

/usr/lib/python2.7/site-packages/graph_tool/__init__.py in init_edge_classes()
   2000                         e_filter = g.new_edge_property("bool")
   2001                         e_filter.a = [1]
-> 2002                         g.set_edge_filter(e_filter)
   2003                     if v_filtered:
   2004                         v_filter = g.new_vertex_property("bool")

/usr/lib/python2.7/site-packages/graph_tool/__init__.py in set_edge_filter(self, prop, inverted)
   1733         are kept. If the supplied property is ``None``, any previous filtering
   1734         is removed."""
-> 1735         self.__graph.SetEdgeFilterProperty(_prop("e", self, prop), inverted)
   1736         self.__filter_state["edge_filter"] = (prop, inverted)
   1737 

RuntimeError: graph filtering was not enabled at compile time
_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
Brian Ball | 2 May 2013 23:07
Picon

Another Windows 7 64-bit user attempting to get graph-tool running

I am encountering the same errors others have:

configure:16482: checking for main in -lbz2
configure:16501: g++ -o conftest.exe -Wall -Wextra  -ftemplate-depth-150 -Wno-deprecated -Wno-unknown-pragmas -O3 -fvisibility=default -fvisibility-inlines-hidden -Wno-unknown-pragmas   conftest.cpp -lbz2  -lm  >&5
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lbz2

configure:16522: checking for main in -lexpat
configure:16541: g++ -o conftest.exe -Wall -Wextra  -ftemplate-depth-150 -Wno-deprecated -Wno-unknown-pragmas -O3 -fvisibility=default -fvisibility-inlines-hidden -Wno-unknown-pragmas   conftest.cpp -lexpat  -lm  >&5
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lexpat

And finally:

configure:17109: checking consistency of all components of python development environment
configure:17135: gcc -o conftest.exe -g -O2  -Ic:\Python2.7\include  conftest.c -lm  -Lc:\Python2.7\Lib\config -lpython27 None  >&5
gcc.exe: error: None: No such file or directory

Which leads to the error:

configure:17152: result: no
configure:17156: error: in `/c/graph-tool-2.2.23':
configure:17158: error:
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution.  The exact name of this package varies among them.
  ============================================================================

See `config.log' for more details

I am using the mingw32 compiler.  

I'd love to help if anyone has any suggestions but I have to admit that after three days of fighting this, I am stuck and out of ideas.

I do have bzip2 installed - and made copies of both the bzip2.exe and bzip2.dll renaiming them bz2.exe and bz2.dll
expat installed.
All paths double-checked

If anyone else gets graph-tool working on Windows, I'd love  to know how, and if there's anything I can do to help, let me know.

Brian


_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
Anatol Wegner | 29 Apr 2013 14:16
Picon

Graph I/O & pickle

Hi all,
In general which graph format is fastest when writing/reading graphs? I 
am also getting errors when I load pickled and cpickled graphs...That is 
something like:

"TypeError: No registered converter was able to produce a C++ rvalue of 
type std::string from this Python object of type unicode"

Cheers,

Anatol
Rodrigo Agerri | 28 Apr 2013 23:01
Picon

versions and errors

Hello, 

I am using Debian and I have two versions of graph-tool available. I have a program we would like to distribute using graph-tool but it turns out that it runs fine with version graph-tool_2.2.19-1 but it does not with version 2.2.23-1. 

 File "process.py", line 168, in <module>
    main()
  File "process.py", line 126, in main
    processor.process_text((input_text, parse_tree))
  File "process.py", line 100, in process_text
    self.reset_graph()
  File "process.py", line 37, in reset_graph
    self.graph = self.graph_builder.new_graph()
  File "/home/ragerri/pythoncode/corefgraph-en-opener/corefgraph/graph/graph_builder.py", line 92, in new_graph
    GraphWrapper.set_properties(graph=graph, graph_properties={'graph_builder': self})
  File "/home/ragerri/pythoncode/corefgraph-en-opener/corefgraph/graph/utils.py", line 82, in set_properties
    graph.graph_properties[name][graph] = property_value
TypeError: 'NoneType' object does not support item assignment

This error does not arise if I remove [graph]. 

However, i would like to know, if possible, when the library changed this behaviour so I could tell users of my system to install from a particular version of graph-tool to other. 

Thanks! 

Rodrigo

_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
mij.rafee.1344 | 24 Apr 2013 10:28
Picon

Installation on Fedora 18

Can anyone give step by step installation procedure, directed towards noob, for graph-tool in Fedora 18.

_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
Matthias Ekman | 16 Apr 2013 17:18
Picon
Gravatar

Generate random graph from given degree sequence

Hi all,


what is the best way to generate a random graph from a given degree sequence?

``gt.random_graph`` has lots of features, but I can't find a way to provide a degree sequence.

I appreciate your help,
 Matthias
_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
CFK | 11 Apr 2013 03:00
Picon

Are these bugs?

Hi all, I'm trying to verify that I'm looking at bugs in graph_tool, and not my own user error.

A little background:

I'm using graph_tool to search over graphs that have been generated by graph_tool.generation.geometric_graph().  The graph represents an occupancy grid that some simulated robots are traversing.  The robots do not know apriori which vertices are occupied, so they have to update their own internal maps of the world as they try to move.  They do this by updating an internal edge filter (one for each robot) which filters out untraversable edges.  In this way, I have one graph, and multiple edge filters, which works fairly well when I'm trying to use either graph_tool.search.dijkstra_search() or graph_tool.search.astar_search() functions to decide where to go next (I swap filters more or less non-stop).

To test out how well this works, I'm randomly generating graphs and occupied vertices, and then running my code on those randomly generated graphs.  Sometimes I'll end up with 50-60 tests successfully completed, and sometimes it'll die on the first test.  I have no idea when or how it will die, and when I've set up code to draw the graph immediately prior to calling either dijkstra or astar, the graphs don't look particularly strange, nor do they have anything in common with one another.  It just dies with a "RuntimeError: maximum recursion depth exceeded" exception as shown below.

I'm also getting the divide by zero errors that cairo is complaining about, but I'm less worried about those as they are just part of my debugging display code.  In the worst case, I can find a way of displaying everything using some other method.

Build info:

>> uname -a
Linux forge 3.2.0-40-generic #64-Ubuntu SMP Mon Mar 25 21:22:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
>> python
Python 2.7.3 (default, Aug  1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> numpy.__version__
'1.6.1'
>>> graph_tool.__version__
'2.2.23 (commit 66e8c6a6, Wed Mar 20 14:51:22 2013 +0100)'

Note that I built it with OpenMP enabled.  If someone can tell me how to enable more debugging output, I can do that and send the output somewhere.

Thanks,
Cem Karan

The complete stack trace:

ckaran <at> forge:~/fuerte_workspace/gridWorldSimulator/src$ nosetests --nocapture --nologcapture -x Random_walk_robot_test.py:Random_walk_robot_test.test_call
..../usr/lib/python2.7/dist-packages/graph_tool/draw/cairo_draw.py:957: RuntimeWarning: divide by zero encountered in double_scalars
  zoom_y = (geometry[1] - sum(y_delta)) / (y_range[1] - y_range[0])
......................../usr/lib/python2.7/dist-packages/graph_tool/draw/cairo_draw.py:956: RuntimeWarning: divide by zero encountered in double_scalars
  zoom_x = (geometry[0] - sum(x_delta)) / (x_range[1] - x_range[0])
.E
======================================================================
ERROR: Random_walk_robot_test.Random_walk_robot_test.test_call(8, 9)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/ckaran/fuerte_workspace/gridWorldSimulator/src/Random_walk_robot_test.py", line 122, in _test_call_helper
    if not random_walk_bot():
  File "/home/ckaran/fuerte_workspace/gridWorldSimulator/src/Random_walk_robot.py", line 71, in __call__
    result = self._nearest_unexplored_vertex()
  File "/home/ckaran/fuerte_workspace/gridWorldSimulator/src/ABC_Robot.py", line 254, in _nearest_unexplored_vertex
    (dist_map, pred_map) = self._dijkstra_search(self._current_vertex, self._edge_might_be_traversable_property)
  File "/home/ckaran/fuerte_workspace/gridWorldSimulator/src/ABC_Robot.py", line 237, in _dijkstra_search
    self._world_map.world_graph.edge_properties[Globals.EDGE_WEIGHT])
  File "/usr/lib/python2.7/dist-packages/graph_tool/decorators.pyc", line 2, in dijkstra_search
    �`\Qc <at> `s�dZddlmZmZmZdZdZdZddddl     Z       ddl
  File "/usr/lib/python2.7/dist-packages/graph_tool/search/__init__.py", line 133, in wrap
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/graph_tool/search/__init__.py", line 865, in dijkstra_search
    compare, combine, zero, infinity)
  File "/usr/lib/python2.7/dist-packages/graph_tool/search/__init__.py", line 105, in wrap
    ret = func(*args, **kwargs)

<< About 500 lines of repetition of the above 2 lines>>

  File "/usr/lib/python2.7/dist-packages/graph_tool/search/__init__.py", line 105, in wrap
    ret = func(*args, **kwargs)
RuntimeError: maximum recursion depth exceeded
_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
Alexandre Hannud Abdo | 19 Mar 2013 20:16
Picon
Gravatar

Tiago's brithday

Ni!

I'd like to point out that this dude is answering bugs on this mailing
list on his birthday, and even that is just a tiny demonstration of how
awesome he is.

(Though I suspect his girlfriend doesn't really understand why =D)

Happy birthday Tiago!

May your life be integer, your happiness double, your networks fully
connected, and your property maps full of treasure =)

Hugs,

ale
.~´
_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
arnfred | 19 Mar 2013 09:39
Gravatar

Fast initialization of graph

Hi there

I've just started using graph tool, and so far I'm very impressed with the
ease of use and the thorough documentation.

I'm currently trying to instantiate a fully connected graph with some 600
vertices, but I find that adding all the edges usually takes around 10
seconds on my system. The fastest way of doing it that I have come up with
so far is to write:

from itertools import combinations
edges = [g.add_edge(v1,v2) for (v1,v2) in combinations(g.vertices(),2)]

But I'm wondering if there is a faster method?

Thanks for a great tool

Jonas

--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Fast-initialization-of-graph-tp4025012.html
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.

Gmane