[graph-tool] Re: Fwd: Adding label to vertices

2022-02-22 Thread Alexandre Hannud Abdo

Ni! You'd access them as internal property maps, in your case:

g.vp["label"] and g.ep["weight"]

But as Tiago pointed out, graph-tool does preserve the ids as property maps in 
case you used them to store graph data.

The advantage of using the proper format is that it will work the same with any 
software, that it will work for non-unique properties, that you can store 
multiple properties, and also declare their types.

Best,

ale

.~´

Le 21/02/2022 à 12:16, RAFAEL SERAPILHA DURELLI a écrit :



- Mensagem encaminhada -
De: *RAFAEL SERAPILHA DURELLI* 
Data: seg., 21 de fev. de 2022 às 11:35
Assunto: Re: [graph-tool] Adding label to vertices
Para: Alexandre Hannud Abdo 


Ok, I managed to use the data/key nodes.

Thanks a lot.

However, how can I access them after loading the grapheme file?



See the graphml example:


http://graphml.graphdrawing.org/xmlns; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd;> http://attr.name>="label" 
attr.type="string"> http://attr.name>="weight" attr.type="double"/>   "US10095832B2"  
 15   


How can I access the 15 and the label ?

Thanks a lot







On 21 Feb 2022, at 11:01, Alexandre Hannud Abdo  wrote:

Ni! Hi Rafael,

In graphml, ids are not graph data. If your source uses node ids for data you should fix it and use 
/ instead (see 'Additional Data' in 
<http://graphml.graphdrawing.org/specification.html> 
<http://graphml.graphdrawing.org/specification.html>). Node ids are for internal parsing use and 
are not guaranteed to be preserved.

Once your source produces labels as specified by the graphml format, in the 
graph-tool loaded Graph that data will be available as internal property maps:

https://graph-tool.skewed.de/static/doc/quickstart.html#internal-property-maps

Hope this helps,

ale

.~´

Le 21/02/2022 à 10:00, RAFAEL SERAPILHA DURELLI a écrit :

Hello, guys

I have been learning graph-tool.. I would like to know if it is possible to create/load 
vertices and edges with labels. Im loading a graphml file, and in this file the node id = 
A, B ,C etc. However, when the loading is done, all vertex are transformed into numbers. 
I would like to know if is it possible to preservate the vertex name, such as A, B, C, 
"anyStrings", etc.

Thanks in advance

--

At.te
Prof. Dr. Rafael S. Durelli.

O conteúdo deste e-mail e anexos são restritos aos seus destinatários e de 
responsabilidade do remetente. O uso do e-mail deve estar de acordo com os 
regulamentos institucionais vigentes.

___
graph-tool mailing list --graph-tool@skewed.de
To unsubscribe send an email tograph-tool-le...@skewed.de


--

At.te
Prof. Dr. Rafael S. Durelli.

O conteúdo deste e-mail e anexos são restritos aos seus destinatários e de 
responsabilidade do remetente. O uso do e-mail deve estar de acordo com os 
regulamentos institucionais vigentes.

___
graph-tool mailing list --graph-tool@skewed.de
To unsubscribe send an email tograph-tool-le...@skewed.de___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de


Re: [graph-tool] Description length of consensus partition

2021-04-09 Thread Alexandre Hannud Abdo
Ni! Hi Haiko,

Do you mean the nested description length as in:

NestedBlockState(h, c_nested).entropy()

?

.~´

On Fri, Apr 9, 2021 at 4:41 PM Lietz, Haiko  wrote:

> Dear Tiago, all,
>
>
>
> I’m happy to have discovered the new partition overlap functionality. It
> works very nicely. But is it possible to obtain the description length of a
> nested consensus state?
>
>
>
> Getting the description length of the consensus state works fine for an
> unnested model:
>
>
>
> from graph_tool.all import *
>
> h = collection.data['polbooks']
>
> num_models = 2
>
> states = [minimize_blockmodel_dl(h) for i in range(num_models)]
>
> bs = [states[i].get_blocks().a for i in range(num_models)]
>
> c, r = partition_overlap_center(bs)
>
>
>
> h_blocks = h.new_vp('int')
>
> h_blocks.a = c
>
> BlockState(h, h_blocks).entropy()
>
>
>
> For nested partitions, getting the consensus state is a bit more
> complicated:
>
>
>
> states_nested = [minimize_nested_blockmodel_dl(h) for i in
> range(num_models)]
>
> bs_nested = []
>
> for j in range(num_models):
>
> l = []
>
> for k in range(len(states_nested[j].get_levels())):
>
> l.append(states_nested[j].get_bstack()[k].vp.b.a)
>
> bs_nested.append(l)
>
> c_nested, r_nested = nested_partition_overlap_center(bs_nested)
>
>
>
> But how can I get its description length?
>
>
>
> Many thanks for your attention
>
>
>
> Haiko
>
> GESIS, Cologne
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] numpy not found when run ./configure

2021-04-08 Thread Alexandre Hannud Abdo
Ni! Hi,

That is the good version. It seems the configure script wasn't updated to
require python3 until later.

I'm going to stress this again: please, first try using a prepackaged build.

Only in case none of the prepackaged options serve you, then:

0. Make sure you've read and understood the the Manual compilation
instructions

.

1. You must tell configure to use the right version of python by calling it
with `PYTHON=python3 ./configure`. In this way it will hopefully detect the
right python version.

2. If that doesn't help, try checking out and compiling the `master` branch
from git. Configure should make all the right checks in that (when using
git branches you'll have to first generate `configure` yourself by running
`./autogen.sh`). If you don't know git and still want to try this, there
are plenty of tutorials online.

If you need to ask more questions, describe in detail the system you're
compiling in (distribution, version, how was python3 installed etc), and
dump the whole of config.log into some pastebin-like URL. Otherwise we
won't be able to help.

Best,
.~´


On Wed, Apr 7, 2021 at 12:39 PM Kasper  wrote:

> Thanks for your reply!
>
> I'm trying to install graph-tool-2.37 which I believed to be a newer
> version, so Python3 should be all right or am I wrong?
>
> cheers Kasper
>
>
>
> --
> Sent from: https://nabble.skewed.de/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] numpy not found when run ./configure

2021-04-07 Thread Alexandre Hannud Abdo
Ni!

Your check says you've got numpy installed for python3.6 ... and yet your
configure output tells us you're compiling for python-2.7.

Which version of graph-tool are you even compiling ? Recent versions
require python 3. Old versions are not supported and not recommended. Also,
make sure you have a very good reason to be compiling it instead of using
one of the many prepackaged options
.

Cheers,

.~´

On Wed, Apr 7, 2021 at 12:25 PM Kasper  wrote:

> when I run ./configure this is the output I get:
>
> checking build system type... x86_64-pc-linux-gnu
> checking host system type... x86_64-pc-linux-gnu
> checking target system type... x86_64-pc-linux-gnu
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for a race-free mkdir -p... /bin/mkdir -p
> checking for gawk... gawk
> checking whether make sets $(MAKE)... yes
> checking whether make supports nested variables... yes
> checking how to create a pax tar archive... gnutar
> checking whether make supports nested variables... (cached) yes
> checking whether make supports the include directive... yes (GNU style)
> checking for gcc... gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether the compiler supports GNU C... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to enable C11 features... none needed
> checking whether gcc understands -c and -o together... yes
> checking dependency style of gcc... gcc3
> checking for library containing strerror... none required
> checking for stdio.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for strings.h... yes
> checking for sys/stat.h... yes
> checking for sys/types.h... yes
> checking for unistd.h... yes
> checking for wchar.h... yes
> checking for minix/config.h... no
> checking whether it is safe to define __EXTENSIONS__... yes
> checking whether _XOPEN_SOURCE should be defined... no
> checking for g++... g++
> checking whether the compiler supports GNU C++... yes
> checking whether g++ accepts -g... yes
> checking for g++ option to enable C++11 features... none needed
> checking dependency style of g++... gcc3
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking how to print strings... printf
> checking for a sed that does not truncate output... /bin/sed
> checking for fgrep... /bin/grep -F
> checking for ld used by gcc... /usr/bin/ld
> checking if the linker (/usr/bin/ld) is GNU ld... yes
> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
> checking the name lister (/usr/bin/nm -B) interface... BSD nm
> checking whether ln -s works... yes
> checking the maximum length of command line arguments... 1572864
> checking how to convert x86_64-pc-linux-gnu file names to
> x86_64-pc-linux-gnu format... func_convert_file_noop
> checking how to convert x86_64-pc-linux-gnu file names to toolchain
> format... func_convert_file_noop
> checking for /usr/bin/ld option to reload object files... -r
> checking for objdump... objdump
> checking how to recognize dependent libraries... pass_all
> checking for dlltool... no
> checking how to associate runtime and link libraries... printf %s\n
> checking for ar... ar
> checking for archiver @FILE support... @
> checking for strip... strip
> checking for ranlib... ranlib
> checking command to parse /usr/bin/nm -B output from gcc object... ok
> checking for sysroot... no
> checking for a working dd... /bin/dd
> checking how to truncate binary pipes... /bin/dd bs=4096 count=1
> checking for mt... mt
> checking if mt is a manifest tool... no
> checking for dlfcn.h... yes
> checking for objdir... .libs
> checking if gcc supports -fno-rtti -fno-exceptions... no
> checking for gcc option to produce PIC... -fPIC -DPIC
> checking if gcc PIC flag -fPIC -DPIC works... yes
> checking if gcc static flag -static works... yes
> checking if gcc supports -c -o file.o... yes
> checking if gcc supports -c -o file.o... (cached) yes
> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared
> libraries... yes
> checking whether -lc should be explicitly linked in... no
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs... immediate
> checking whether stripping libraries is possible... yes
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... no
> checking how to run the C++ preprocessor... g++ -E
> checking for ld used by g++... /usr/bin/ld -m elf_x86_64
> checking if 

Re: [graph-tool] graph-tool memory usage

2021-02-08 Thread Alexandre Hannud Abdo
Yes.

And you can entirely avoid compilation if you install from binary packages
such as those available for Debian, Ubuntu, Conda, and Homebrew, or if you
use a Docker container. From what I can tell of your current level of
understanding, I strongly advise you to do that. Please see <
https://git.skewed.de/count0/graph-tool/-/wikis/installation-instructions>.

Let me just advance that questions about how to operate your operating
system's package manager, or docker, or compilers, are off-topic for this
list. You can try stackoverflow if you need to learn those kinds of things.
You may post here about installation issues if you have precisely followed
the installation instructions and something doesn't work that you believe
is related to graph-tool.

Best,
.~´

On Tue, Feb 9, 2021 at 12:55 AM nikhrao  wrote:

> Hi Alexandre,
>
> Thanks for the response! So if I'm understanding correctly, when the
> documentation says "Graph-tool's
> performance comes at the cost of increased time and memory required during
> compilation" that is referring to a one-time event at the time of
> installation?
>
> Thanks,
> N
>
>
>
> --
> Sent from: https://nabble.skewed.de/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] graph-tool memory usage

2021-02-08 Thread Alexandre Hannud Abdo
Ni!

The algorithms in graph-tool are written in C++, just like the algorithms
in igraph are writen in C. In both cases, the C++/C code gets compiled
before installation.

Graph-tool's python library, like the higher level libraries for igraph,
are only interfaces to the underlying compiled code.

Therefore, there is no relationship between "filtering capabilities"
increasing compile time, and the runtime speed or memory consumption of
graph-tool.

For the kind of things you describe, if igraph does it within your memory
limits, graph-tool should do it as well. And for the numbers you give, it
should be orders of magnitude lower than what you're expecting.

Cheers,
.~´


On Tue, Feb 9, 2021 at 12:12 AM nikhrao  wrote:

> Hi Alexandre,
>
> Thanks for the response! Yes, sorry for the confusion. I think I have a key
> misunderstanding (I haven't used python before). When you refer to
> compilation, does python compile the code I write as I write it? Or rather,
> is the code compiled once I decide to run it, and it's at this step that
> the
> memory usage is high due to filtering?
>
> For context, the networks that I'm working with have around 400,000
> vertices
> and 300,000 edges. If I tried fairly rudimentary tasks such as computing
> the
> degree for each vertex or computing eigenvector centrality, would these
> require large amounts of RAM (say, 90-100 GB) due the filtering
> capabilities
> that graph-tool has? I'm just trying to get an idea of the upper bound of
> memory requirements that I may need on my server.
>
> Thanks,
> N
>
>
>
> --
> Sent from: https://nabble.skewed.de/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] graph-tool memory usage

2021-02-08 Thread Alexandre Hannud Abdo
Ni! Hi Nikhrao,

Please note that the phrase you've extracted contains the words «during
compilation» while you seem to be talking about runtime memory usage.

Runtime memory usage will depend on the algorithm you'll be running and
choices of the implementation, as there's often a tradeoff between memory
usage and speed.

You can count that graph-tool strikes a good balance that will serve most
scenarios, and in some cases there are parameters to adjust for extreme
situations. Having never used igraph, I'd assume it strives for a similar
goal.

I strongly recommend you to try it yourself on your actual use case.
Otherwise, you'd have to provide much more detail about it for us to give
you a theoretical answer that won't be worth as much as simply running the
algorithm you want on the kind of data you expect to treat.

Now, if you just want a "general idea" about memory consumption, I
personally see no technical reason to expect big differences when comparing
algorithms supported by both libraries.

Best,
ale
.~´

On Mon, Feb 8, 2021 at 11:14 PM nikhrao  wrote:

> Hi all,
>
> I'm a current R-igraph user trying to understand the feasibility of
> switching to graph-tool. I have some memory constraints on the server I'm
> using and I'm trying to understand how graph-tool operates.
>
> The performance comparison documentation says the following: "Graph-tool's
> performance comes at the cost of increased time and memory required during
> compilation. This is mostly due to the in-place graph filtering
> functionality..". Since filtering seems to me to be a chiefly
> visualization-related task, does graph-tool typically require large amounts
> of RAM due to filtering only for visualization, but not for other tasks? Or
> is it the case that filtering is continually occurring under the hood and
> hence graph-tool uses large amounts of memory in general?
>
> Thanks!
>
>
>
> --
> Sent from: https://nabble.skewed.de/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] efficent way to assign values to vector property map

2020-06-13 Thread Alexandre Hannud Abdo
Ni! Hello Bleak,

I trust two possible solutions to your question stand in plain sight in the
sections of the documentation pertaining to property maps.

https://graph-tool.skewed.de/static/doc/graph_tool.html#graph_tool.Graph.new_vertex_property
https://graph-tool.skewed.de/static/doc/graph_tool.html#graph_tool.PropertyMap.set_2d_array

I'm sure you'll remember to consult it more carefully in the future (=

Cheers,
ale
.~´


On Sat, Jun 13, 2020 at 6:44 PM BleakHeart  wrote:

> Hi tiago,
> I was thinking if there is an efficient way to assing values to a vector
> property map.
> The only working method that I can use is the following:
>
> vprop = g.new_vertex_property("vector")
> for i in range(G.num_vertices()):
>vprop[G.vertex(i)] = [1,2,3]
>
> When I try to use something like this:
>
> index = np.where(some condition on vertex properties)[0]
> vprop.a[index] = [1,2,3]
>
> It gives me the error: "TypeError: 'NoneType' object does not support item
> assignment".
> The error comes only with vector< > type properties.
> I am using this to assing colours to some vertices if a given condition is
> satified.
> I hope that you can help, because the first method is really slow on graphs
> with hundred of thousands vertices.
>
>
>
> --
> Sent from:
> http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] working with hypergraphs - node_x_edge input

2020-03-04 Thread Alexandre Hannud Abdo
Ni! Hi Alireza,

Yep, that's what I meant.

As a note, this is what the adjacency matrix for any bipartite graph can be
reordered to look like - or undirected bipartite graph in your particular
case.

Note that in SBM terms this corresponds to two blocks that only connect
across, which is why one should impose that constraint using `pclabel`,
sparing the algorithm from inferring it.
(And in a hypergraph interpretation you likely wouldn't want blocks mixing
hyperedges and nodes to start with.)

[]s
ale
.~´


On Tue, Mar 3, 2020 at 6:48 PM Alireza Kashani <
alireza.kashanip...@gmail.com> wrote:

> Dear Alexander,
>
> Thanks for your answer, regarding the treatment,
> For example, if my data looks like
>
>
> p1 p2 p3 p4 p5 p6
> j1 1 0 1 0 1 0
> j2 0 1 1 0 0 1
> j3 0 0 0 1 1 1
> j4 1 0 0 1 0 0
>
> are you suggesting to treat it as
>
>
> j1 j2 j3 j4 p1 p2 p3 p4 p5 p6
> j1 0 0 0 0 1 0 1 0 1 0
> j2 0 0 0 0 0 1 1 0 0 1
> j3 0 0 0 0 0 0 0 1 1 1
> j4 0 0 0 0 1 0 0 1 0 0
> p1 1 0 0 1 0 0 0 0 0 0
> p2 0 1 0 0 0 0 0 0 0 0
> p3 1 1 0 0 0 0 0 0 0 0
> p4 0 0 1 1 0 0 0 0 0 0
> p5 1 0 1 0 0 0 0 0 0 0
> p6 0 1 1 0 0 0 0 0 0 0
>
> to be an adjacency matrix ?
> Thanks,
>
>
> On Tue, Mar 3, 2020 at 5:32 PM Alexandre Hannud Abdo 
> wrote:
>
>> Ni!
>>
>> Incidence matrices can be trated as a subset of an adjacency matrix (and
>> in this sense hypergraphs as a special case of graphs), so in principle
>> there is no problem to work around. You just need to properly interpret the
>> model in terms of membership to hyperedges instead of connections to nodes.
>>
>> You should hardcode the bipartite structure when running the DL
>> minimization in order to save processing time (see the pclabel param).
>>
>> If you're convinced that this doesn't suite your needs, you should
>> explicitly formulate your conceptual issue so we can provide useful advice.
>>
>> Cheers!
>>
>> .~´
>>
>> On Tue, Mar 3, 2020 at 5:23 AM Alireza Kashani <
>> alireza.kashanip...@gmail.com> wrote:
>>
>>> Thanks Alexander,
>>>
>>> May be my question was not clear enough - as you said, my data is
>>> already an incident matrix.
>>> I would like to use stochastic-block-models, and seems they only work
>>> with adjacency matrices. Therefore, I wonder what are the possibilities to
>>> work-around this problem.
>>>
>>> Br
>>>
>>>
>>> On Mon, Mar 2, 2020 at 9:35 PM Alexandre Hannud Abdo <
>>> a...@member.fsf.org> wrote:
>>>
>>>> Ni! Hi Alireza,
>>>>
>>>> One way to work with hypergraphs is to use the incidence graph
>>>> <https://en.wikipedia.org/wiki/Hypergraph> representation of the
>>>> hypergraph.
>>>>
>>>> Abraços,
>>>> ale
>>>> .~´
>>>>
>>>> On Mon, Mar 2, 2020 at 5:28 PM Alireza Kashani <
>>>> alireza.kashanip...@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I wonder how one can work with hyper-graphs using graph-tool. For
>>>>> example in my work, I would like to feed a data where rows are journals 
>>>>> and
>>>>> columns are papers out-going citations. I understand such a binary matrix,
>>>>> can not be used as an adjacency matrix but I am curious if it is possible
>>>>> to work with this type of input. Otherwise, I appreciate to hear your
>>>>> thoughts on converting this matrix into a adjacency matrix.
>>>>>
>>>>> Br
>>>>> Alireza
>>>>> ___
>>>>> graph-tool mailing list
>>>>> graph-tool@skewed.de
>>>>> https://lists.skewed.de/mailman/listinfo/graph-tool
>>>>>
>>>> ___
>>>> graph-tool mailing list
>>>> graph-tool@skewed.de
>>>> https://lists.skewed.de/mailman/listinfo/graph-tool
>>>>
>>> ___
>>> graph-tool mailing list
>>> graph-tool@skewed.de
>>> https://lists.skewed.de/mailman/listinfo/graph-tool
>>>
>> ___
>> graph-tool mailing list
>> graph-tool@skewed.de
>> https://lists.skewed.de/mailman/listinfo/graph-tool
>>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] working with hypergraphs - node_x_edge input

2020-03-03 Thread Alexandre Hannud Abdo
Ni!

Incidence matrices can be trated as a subset of an adjacency matrix (and in
this sense hypergraphs as a special case of graphs), so in principle there
is no problem to work around. You just need to properly interpret the model
in terms of membership to hyperedges instead of connections to nodes.

You should hardcode the bipartite structure when running the DL
minimization in order to save processing time (see the pclabel param).

If you're convinced that this doesn't suite your needs, you should
explicitly formulate your conceptual issue so we can provide useful advice.

Cheers!

.~´

On Tue, Mar 3, 2020 at 5:23 AM Alireza Kashani <
alireza.kashanip...@gmail.com> wrote:

> Thanks Alexander,
>
> May be my question was not clear enough - as you said, my data is already
> an incident matrix.
> I would like to use stochastic-block-models, and seems they only work with
> adjacency matrices. Therefore, I wonder what are the possibilities to
> work-around this problem.
>
> Br
>
>
> On Mon, Mar 2, 2020 at 9:35 PM Alexandre Hannud Abdo 
> wrote:
>
>> Ni! Hi Alireza,
>>
>> One way to work with hypergraphs is to use the incidence graph
>> <https://en.wikipedia.org/wiki/Hypergraph> representation of the
>> hypergraph.
>>
>> Abraços,
>> ale
>> .~´
>>
>> On Mon, Mar 2, 2020 at 5:28 PM Alireza Kashani <
>> alireza.kashanip...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I wonder how one can work with hyper-graphs using graph-tool. For
>>> example in my work, I would like to feed a data where rows are journals and
>>> columns are papers out-going citations. I understand such a binary matrix,
>>> can not be used as an adjacency matrix but I am curious if it is possible
>>> to work with this type of input. Otherwise, I appreciate to hear your
>>> thoughts on converting this matrix into a adjacency matrix.
>>>
>>> Br
>>> Alireza
>>> ___
>>> graph-tool mailing list
>>> graph-tool@skewed.de
>>> https://lists.skewed.de/mailman/listinfo/graph-tool
>>>
>> ___
>> graph-tool mailing list
>> graph-tool@skewed.de
>> https://lists.skewed.de/mailman/listinfo/graph-tool
>>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] working with hypergraphs - node_x_edge input

2020-03-02 Thread Alexandre Hannud Abdo
Ni! Hi Alireza,

One way to work with hypergraphs is to use the incidence graph
 representation of the hypergraph.

Abraços,
ale
.~´

On Mon, Mar 2, 2020 at 5:28 PM Alireza Kashani <
alireza.kashanip...@gmail.com> wrote:

> Hi,
>
> I wonder how one can work with hyper-graphs using graph-tool. For example
> in my work, I would like to feed a data where rows are journals and columns
> are papers out-going citations. I understand such a binary matrix, can not
> be used as an adjacency matrix but I am curious if it is possible to work
> with this type of input. Otherwise, I appreciate to hear your thoughts on
> converting this matrix into a adjacency matrix.
>
> Br
> Alireza
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Random graph with degree sequence.

2019-11-07 Thread Alexandre Hannud Abdo
Ni!
Hi Alvaro, this is explained in the documentation for the
graph_tool.generation.random_graph

function concerning the `deg_sampler`:

> Optionally, you can also pass a function which receives one or two
> arguments. If block_membership is None, the single argument passed will
> be the index of the vertex which will receive the degree. If
> block_membership is not None, the first value passed will be the vertex
> index, and the second will be the block value of the vertex.
>
Cheers,
.~´


On Thu, Oct 31, 2019 at 9:37 PM Alvaro Sechinel  wrote:

> Hi,
>
> I'm using graph-tool to try to generate random graphs with a sequence of
> degrees. For example, in a 3-node graph, I generated a random graph with
> all nodes with input degrees 1 and output degrees 1.
>
> My code:
>
> >>> import graph_tool.all as gt>>> def deg_sampler():...  return 1,1... 
> >>> >>> g = gt.random_graph(3,deg_sampler,parallel_edges=True, 
> >>> self_loops=False)>>> gt.graph_draw(g)
>
> Can I generate a random graph defining the input and output degrees of
> each node? For example, tree nodes with respectively the input degrees (1,
> 2, 0) and output degrees (1, 0, 2).
>
> Thanks,
>
> Alvaro
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Problem extracting hierarchical blocks

2019-08-29 Thread Alexandre Hannud Abdo
Ni! Hi James, see below.

On Thu, Aug 29, 2019 at 4:59 PM James Ruffle  wrote:

>
> r = levels[0].get_blocks()[idx] # group membership of node idx in
> level 0
> vertexblocksdf.ix[idx, 'level0'] = r
>
> r = levels[0].get_blocks()[r] # group membership of node idx in
> level 1
> vertexblocksdf.ix[idx, 'level1'] = r
>

Shouldn't here the second paragraph be `levels[1]`, and so forth?

In any case, take a look at the `state.project_level()` method, as it
provides what you're looking for.

Also, I wouldn't use `.ix[]`, as it has been deprecated in pandas for quite
a while now.

Abraços,
l
e
.~´
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Graph views via property maps

2019-08-29 Thread Alexandre Hannud Abdo
Ni! Hi Haiko,

GraphView can simultaneously take `vfilt` and `efilt` parameters, if that
is what you wanna know. So,

g_filter = GraphView(g, vfilt=vp_filter, efilt=ep_filter)

should work just fine.

Regarding your code snippet, the 'elegance' issues are kinda unrelated to
graph_tool. For example, in the second part, you iterate the dataframe
instead of simply iterating the graph edges and getting the edge layer from
the internal property map. You also use an if clause to assign the boolean
value of the if clause, instead of directly assigning it. So, this is
equivalent to your `for` loop:

for e in g.edges():

ep_filter[e] = g.edge_properties['layer'][e] == layer

All the best,

.~´




On Thu, Aug 29, 2019 at 10:49 AM Lietz, Haiko  wrote:

> Hi all,
>
>
>
> gt allows creating graph views where vertices and/or edges are filtered
> out. The principle is described in the documentation:
>
>
>
> "Vertices or edges which are to be filtered should be marked with a
> PropertyMap with value type bool, and then set with set_vertex_filter() or
> set_edge_filter() methods. By default, vertex or edges with value '1' are
> kept in the graphs, and those with value '0' are filtered out." (
> https://graph-tool.skewed.de/static/doc/quickstart.html#graph-filtering)
>
>
>
> Given a layered graph, where layers are coded via an edge property, I want
> to draw the graphs layer by layer.
>
>
>
> This is an example graph:
>
> from graph_tool.all import *
>
> import numpy as np
>
> import pandas as pd
>
> # data
>
> edge_list = pd.DataFrame(np.array([[0, 1, 0], [1, 2, 1], [2, 0, 2]]),
> columns=['i', 'j', 'layer'])
>
> # create graph
>
> g = Graph(directed=False)
>
> ep_layer = g.new_edge_property('int')
>
> g.add_edge_list(edge_list.values, eprops=[ep_layer])
>
> g.edge_properties['layer'] = ep_layer
>
> # draw graph with edge colors showing the layers
>
> graph_draw(g, edge_color=g.ep.layer)
>
>
>
> It is possible to draw a single layer (in this example layer 0) in this
> complicated way:
>
>
>
> # set layer to be drawn
>
> layer = 0
>
> # create graph view
>
> ep_filter = g.new_edge_property('bool')
>
> for i in range(0, len(edge_list)):
>
> e = g.edge(edge_list['i'][i], edge_list['j'][i])
>
> if edge_list['layer'][i] == layer:
>
> ep_filter[e] = True
>
> else:
>
> ep_filter[e] = False
>
> g_filter = GraphView(g, efilt=ep_filter)
>
> # draw filtered graph
>
> graph_draw(g_filter, edge_color=g.ep.layer)
>
>
>
> If I proceed this way I will also have to create a vertex property map to
> filter unused vertices and do these steps for all layers I want to draw.
>
>
>
> But isn’t there a more elegant way – preferably handling vertices and
> edges in the same step?
>
>
>
> Many thanks and best wishes
>
>
>
> Haiko
>
>
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Fwd: Can I use graph-tool for analyzing temporal network?

2019-08-23 Thread Alexandre Hannud Abdo
Ni! Hey Sara,

The short answer is yes, you can do a lot with graph-tool for these kinds
of networks.

Did you take a look at the documentation, and did you not find something
you were expecting?

Any answer longer than this requires you to be way more specific about what
kind of analysis you plan to carry on.

Abraços,
l
e
.~´


On Tue, Aug 20, 2019 at 2:05 PM Sara Ansari  wrote:

>
>
> -- Forwarded message -
> From: Sara Ansari 
> Date: Tue, Aug 20, 2019 at 1:51 PM
> Subject: Can I use graph-tool for analyzing temporal network?
> To: 
> Cc: Jobst Heitzig 
>
>
> Hello all,
>
> I'm going to choose and install a network tool for analyzing a kind of
> temporal weighted and directed complex network. is graph-tool
> suitable for it? if no, can any one suggest a right tool for it?
>
> Best regards,
> Sara
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Edge property map for int type

2019-01-11 Thread Alexandre Hannud Abdo
Well...
The first maps each vertex to a vector of ints, i.e. `v => [4, 9, -2, 1]`,
the second maps each vertex to a single int, i.e. `v => 4`.
.~´

On Fri, Jan 11, 2019 at 2:36 PM ashutosh  wrote:

> can you also tell me the difference between the two
>
> 'vector' and 'int'  property types ?
>
>
>
> --
> Sent from:
> http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Edge property map for int type

2019-01-11 Thread Alexandre Hannud Abdo
Hi Ashuein,

You're trying to push `int` values into a `vector` type. You should
use a `int` for the property map instead.

.~'

On Friday, January 11, 2019, ashutosh  wrote:
>
> pdat =
>
pd.DataFrame({'source':['A','B','C'],'target':['p','q','r'],'weight':[1,-1,2]})
>
> graph = gt.Graph(directed=True)
> eprop = graph.new_edge_property("vector")
>
> vprop =
> graph.add_edge_list(pdat[['source','target','weight']].values.tolist(),
>
> hashed=True,string_vals=True,eprops=[eprop])
>
>
> I get the error
>
> TypeError: 'int' object is not iterable
>
>
> But not when the eprop  is 
>
>
> I know I am missing something, but the property map page in the
> documentation doesn't elaborate clearly.
>
>
>
> --
> Sent from:
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Slow filling graph

2018-11-26 Thread Alexandre Hannud Abdo
Ni! Hi elastica,

In graph-tool you can efficiently add edges with properties using the
`add_edge_list` function:

https://graph-tool.skewed.de/static/doc/graph_tool.html#graph_tool.Graph.add_edge_list

I'd also suggest that you benchmark python code with the `cProfile` module,
it is much easier and more informative:

https://docs.python.org/3/library/profile.html

Cheers,
ale
.~´

On Sat, Nov 24, 2018 at 7:36 PM  wrote:

> Hi
>
> I was experimenting Kruskal performance against a data file for 100 graphs
> (n, m<2) :
>
>
> # =
> from time import clock
> from sys import stderr, stdin
>
> import graph_tool as gt
> from graph_tool.topology import min_spanning_tree
>
> import networkx as nx
>
>
> #  NetworkX Code ---
>
> def kruskal_networkX(edges, n):
> G=nx.Graph()
> for a, b, w in edges:
> G.add_edge(a,b,weight=w)
> return sum(d['weight'] for (_,_,d) in
> nx.minimum_spanning_tree(G).edges(data=True))
>
>
>
> #  Graph_tool Code ---
>
> def kruskal_gt(wedges,n):
> g= gt.Graph(directed=False)
> edges, weights= zip(*[((a,b),w) for (a,b,w) in wedges])
> weight = g.new_edge_property("long long")
> for a,b,w in wedges:
> e=g.add_edge(a,b)
> weight[e]=w
> tree=min_spanning_tree(g, weights=weight)
> return sum(b*weight[e] for (e,b) in zip(g.edges(), tree))
>
> #  Benchmark ---
>
> def go(solver, L):
> global duration
>
> N=len(L)
> k=1
>
> while k edges=[]
> n=L[k]
> k+=1
>
> for a in range(n):
> d=L[k]
> k+=1
> for j in range(d):
> b=L[k]
> k+=1
> w=L[k]
> k+=1
> if a edges.append([a,b-1,w])
> start=clock()
> print(solver(edges, n))
> print("")
> duration+=clock()-start
>
> # data
> L=list(int(z) for z in stdin.read().split() if z.isdigit())
>
> for solver in [kruskal_networkX, kruskal_gt]:
> duration=0
> go(solver, L)
> print("%s : %.3f" %(solver.__name__, duration), file=stderr)
>
> # =
>
>
>
> Outputs are in agreement but gt execution is very slow:
>
> $ python3 gt.py < big.in > bench.out
> kruskal_networkX : 15.721
> kruskal_gt : 134.839
>
>
> the bottleneck being within the following loop-filling the graph:
>
>
> # 
> for a,b,w in wedges:
> e=g.add_edge(a,b)
> weight[e]=w
> # 
>
>
> Probably, i'm filling the graph in the wrong way.
>
> You can dowload the data file here:
>
> https://drive.google.com/file/d/1y0fX1kopgzQEWgmRHRnouWHnMkuliwfw/view?usp=sharing
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] make[3]: *** [graph_triangulation.lo] Error 1

2018-11-08 Thread Alexandre Hannud Abdo
Ni! Hi Zahra,

This last error seems to be a consequence of boost being compiled with
a different compiler version than graph_tool.

I encourage you to follow Tiago's request and open a bug with the
homebrew issue tracker. Only this will properly fix things for you and
others in the long run.

Now, _assuming you don't need the triangulation function_, I have a
patch applied to one of my systems which lets me disable CGAL:


https://git.skewed.de/solstag/graph-tool/commit/7737cafb3a9a4a3667aadc9b9806ef7c1fd9a4ef

This patch should let you configure with '--disable-cgal' and compile
with your regular compiler without facing your original issue.

Cheers,

ale
.~´

Le jeudi 08 novembre 2018 à 07:17 -0500, Zahra Sheikhbahaee a écrit :
> Hi Tiage,
> 
> I was compiling graph-tool with gcc8.2 and I was getting this error
> then I used gcc7 with this command line:
> ./configure CPPFLAGS="-I/Users/anaconda2/pkgs/pycairo-1.18.0-
> py27h4d1f301_0/include -I/usr/local/include" -with-
> cgal=/Users/anaconda2/pkgs/cgal-4.12-py27h8634a1c_1 --
> prefix=/Users/anaconda2 LDFLAGS="-L/usr/local/lib" CC=gcc-7 CXX=g++-7
> 
> It got compiled but again when I import graph-tool in python, I
> receive this error message:
> 
> >>> from graph_tool.all import *
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/Users/anaconda2/lib/python2.7/site-
> packages/graph_tool/__init__.py", line 111, in 
> dl_import("from . import libgraph_tool_core as libcore")
>   File "/Users/anaconda2/lib/python2.7/site-
> packages/graph_tool/dl_import.py", line 61, in dl_import
> exec(import_expr, local_dict, global_dict)
>   File "", line 1, in 
> ImportError: dlopen(/Users/anaconda2/lib/python2.7/site-
> packages/graph_tool/libgraph_tool_core.so, 8): Symbol not found:
> __ZN5boost6system6detail25generic_category_instanceE
>   Referenced from: /Users/anaconda2/lib/python2.7/site-
> packages/graph_tool/libgraph_tool_core.so
>   Expected in: flat namespace
>  in /Users/anaconda2/lib/python2.7/site-
> packages/graph_tool/libgraph_tool_core.so
> >
> 
> What can be the problem now?
> Thanks again.
> 
> Best,
> Z.
> 
> On Thu, Nov 8, 2018 at 1:33 AM Tiago de Paula Peixoto <
> ti...@skewed.de> wrote:
> > Am 07.11.18 um 10:05 schrieb Zahra Sheikhbahaee:
> > > any suggestion?
> > > 
> > 
> > The homebrew recipe must be patched against the new version of
> > CGAL. Could
> > you please open an issue at the homebrew issue tracker, so that
> > this can be
> > handled there? Thanks!
> > 
> > Best,
> > Tiago
> > 
> > ___
> > graph-tool mailing list
> > graph-tool@skewed.de
> > https://lists.skewed.de/mailman/listinfo/graph-tool


signature.asc
Description: This is a digitally signed message part
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] TypeError while using add_edge_list

2018-07-18 Thread Alexandre Hannud Abdo
Tiny typo, the first argument is `hashed=True`.

On Wed, Jul 18, 2018 at 1:18 PM, Alexandre Hannud Abdo 
wrote:

> Ni! Hi ashu,
>
> Please, always try to *read errors carefully* and consult the
> documentation. Not to mention, provide self-contained examples.
>
> Python is throwing a "TypeError" and telling you it expects an integer
> ('unsigned long', the C++ type for vertex indices) while you are passing it
> a string ('str').
>
> As you can see in the documentation
> <https://graph-tool.skewed.de/static/doc/graph_tool.html>, if you want to
> pass strings to add_edge_list you should set two additional arguments:
> `hash=True` and `string_vals=True`.
>
> If that doesn't fix it, you'll have to provide a self-contained example
> where the error occurs, otherwise we can't really help.
>
> .~´
>
>
>
> On Wed, Jul 18, 2018 at 9:37 AM, ashutosh  wrote:
>
>> Hi,
>>
>> I'm trying to convert two columns of my pandas dataframe into network
>> using
>> them as edge list.
>> A  similar query
>> <https://stackoverflow.com/questions/35459597/graph-tool-rea
>> ding-edge-lists-from-pandas-dataframe>
>> was posted in StackOverflow but with different problem and it didn't help
>> me.
>>
>> When I am trying the following code it gives me error:
>> *
>> myGraph.add_edge_list(i for i in df[['node1','node2']].values.tolist())*
>>
>> Where, my Graph is the graph;  df is the dataframe with 4 columns out of
>> which I am using two 'node1' and 'node2'.
>>
>> *File "/usr/lib/python3/dist-packages/graph_tool/__init__.py", line
>> 2109, in
>> add_edge_list
>> libcore.add_edge_list_iter(self.__graph, edge_list, eprops)*
>>
>> *TypeError: No registered converter was able to produce a C++ rvalue of
>> type
>> unsigned long from this Python object of type str
>> *
>>
>>
>> I tried upgrading my boost library but it doesn't solve the problem. Any
>> suggestions ?
>>
>>
>>
>> --
>> Sent from: http://main-discussion-list-for-the-graph-tool-project.98248
>> 0.n3.nabble.com/
>> ___
>> graph-tool mailing list
>> graph-tool@skewed.de
>> https://lists.skewed.de/mailman/listinfo/graph-tool
>>
>
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] TypeError while using add_edge_list

2018-07-18 Thread Alexandre Hannud Abdo
Ni! Hi ashu,

Please, always try to *read errors carefully* and consult the
documentation. Not to mention, provide self-contained examples.

Python is throwing a "TypeError" and telling you it expects an integer
('unsigned long', the C++ type for vertex indices) while you are passing it
a string ('str').

As you can see in the documentation
, if you want to
pass strings to add_edge_list you should set two additional arguments:
`hash=True` and `string_vals=True`.

If that doesn't fix it, you'll have to provide a self-contained example
where the error occurs, otherwise we can't really help.

.~´



On Wed, Jul 18, 2018 at 9:37 AM, ashutosh  wrote:

> Hi,
>
> I'm trying to convert two columns of my pandas dataframe into network using
> them as edge list.
> A  similar query
>  reading-edge-lists-from-pandas-dataframe>
> was posted in StackOverflow but with different problem and it didn't help
> me.
>
> When I am trying the following code it gives me error:
> *
> myGraph.add_edge_list(i for i in df[['node1','node2']].values.tolist())*
>
> Where, my Graph is the graph;  df is the dataframe with 4 columns out of
> which I am using two 'node1' and 'node2'.
>
> *File "/usr/lib/python3/dist-packages/graph_tool/__init__.py", line 2109,
> in
> add_edge_list
> libcore.add_edge_list_iter(self.__graph, edge_list, eprops)*
>
> *TypeError: No registered converter was able to produce a C++ rvalue of
> type
> unsigned long from this Python object of type str
> *
>
>
> I tried upgrading my boost library but it doesn't solve the problem. Any
> suggestions ?
>
>
>
> --
> Sent from: http://main-discussion-list-for-the-graph-tool-project.
> 982480.n3.nabble.com/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] CGAL library not found (though installed)

2018-06-25 Thread Alexandre Hannud Abdo
Hey Ganesh,

Your make.log tells us the error you're getting is related to an ambiguous
definition of function `vertex` in `graph_reverse.hh`. (More specifically
when `graph_traits::vertices_size_type` and `size_t`
coincide.)

One of the definitions has been removed in the development version of
graph-tool, and your config.log tells us you're compiling the latest (2.26)
release.

So my guess is that this could be an incompatibility introduced by changes
in boost or the compiler since that release, which has already been taken
care of in the master branch. Though I haven't actually tried to compile
the release to see if I get the same error. We'd have to see what Tiago can
say about that more precisely.

Meanwhile, you can try compiling the latest git version of graph-tool <
https://git.skewed.de/count0/graph-tool>, which shouldn't have this
problem. Just notice for that you'll need to run `./autogen.sh` before
running `./configure`.

Cheers,
.~´



On Thu, Jun 21, 2018 at 7:51 PM, Srinivasamoorthy, Ganesh (CDC/OID/NCEZID)
(CTR)  wrote:

> Thanks Alexandre
>
>
>
> I was able to run the ./configure successfully.
>
> The only warning I got was “configure: WARNING: No usable boost::coroutine
> found! Some functionality will be disabled in the library.”
>
> And then when I run make, it fails.
>
> I have attached the new config.log and the output of the make.
>
>
>
> Any guidance is much appreciated
>
>
>
> *From:* graph-tool  *On Behalf Of *Alexandre
> Hannud Abdo
> *Sent:* Thursday, June 21, 2018 11:31 AM
>
> *To:* Main discussion list for the graph-tool project <
> graph-tool@skewed.de>
> *Subject:* Re: [graph-tool] CGAL library not found (though installed)
>
>
>
> Ok, I see you've passed the flag and configure is indeed looking for CGAL
> at /usr/local/lib...
>
>
>
> So it might be that CGAL got installed to /usr/local/lib64 instead.
>
>
>
> If that is the case, try adding to your LDFLAGS:
>
>
>
> -L/usr/local/lib64
>
>
>
> and perhaps also:
>
>
>
> -Wl,-rpath,/usr/local/lib64
>
>
>
> .~´
>
>
>
>
>
> On Thu, Jun 21, 2018 at 5:18 PM, Srinivasamoorthy, Ganesh (CDC/OID/NCEZID)
> (CTR)  wrote:
>
> Hi Ale
>
>
>
> Attached is the copy of the log
>
>
>
> *From:* graph-tool  *On Behalf Of *Alexandre
> Hannud Abdo
> *Sent:* Thursday, June 21, 2018 10:56 AM
> *To:* Main discussion list for the graph-tool project <
> graph-tool@skewed.de>
> *Subject:* Re: [graph-tool] CGAL library not found (though installed)
>
>
>
> Ni! Hi Ganesh,
>
>
>
> `./configure` generates a file called "config.log" when run, that is the
> file you want to transmit when asking for help. A copy/paste of your
> terminal is not nearly as useful.
>
>
>
> Meanwhile, I assume you passed the parameter " --with-cgal=/usr/local/" to
> `./configure`, is that right ?
>
>
>
> Cheers,
>
> ale
>
> .~´
>
>
>
>
>
>
>
>
>
>
>
> On Thu, Jun 21, 2018 at 4:23 PM, Srinivasamoorthy, Ganesh (CDC/OID/NCEZID)
> (CTR)  wrote:
>
> I installed CGAL from source and it installed at /usr/local/include/CGAL/
> Then when I try to build graph-tools (both 2.26 and the source from git)
> give me CGAl not found error. They do seem to be checking in the /usr/local
> directory but don't seem to find it..I have attached a log.
>
>
>
> Is there something I should keep in mind while installing CGAL ?
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] CGAL library not found (though installed)

2018-06-21 Thread Alexandre Hannud Abdo
Ok, I see you've passed the flag and configure is indeed looking for CGAL
at /usr/local/lib...

So it might be that CGAL got installed to /usr/local/lib64 instead.

If that is the case, try adding to your LDFLAGS:

-L/usr/local/lib64

and perhaps also:

-Wl,-rpath,/usr/local/lib64

.~´


On Thu, Jun 21, 2018 at 5:18 PM, Srinivasamoorthy, Ganesh (CDC/OID/NCEZID)
(CTR)  wrote:

> Hi Ale
>
>
>
> Attached is the copy of the log
>
>
>
> *From:* graph-tool  *On Behalf Of *Alexandre
> Hannud Abdo
> *Sent:* Thursday, June 21, 2018 10:56 AM
> *To:* Main discussion list for the graph-tool project <
> graph-tool@skewed.de>
> *Subject:* Re: [graph-tool] CGAL library not found (though installed)
>
>
>
> Ni! Hi Ganesh,
>
>
>
> `./configure` generates a file called "config.log" when run, that is the
> file you want to transmit when asking for help. A copy/paste of your
> terminal is not nearly as useful.
>
>
>
> Meanwhile, I assume you passed the parameter " --with-cgal=/usr/local/" to
> `./configure`, is that right ?
>
>
>
> Cheers,
>
> ale
>
> .~´
>
>
>
>
>
>
>
>
>
>
>
> On Thu, Jun 21, 2018 at 4:23 PM, Srinivasamoorthy, Ganesh (CDC/OID/NCEZID)
> (CTR)  wrote:
>
> I installed CGAL from source and it installed at /usr/local/include/CGAL/
> Then when I try to build graph-tools (both 2.26 and the source from git)
> give me CGAl not found error. They do seem to be checking in the /usr/local
> directory but don't seem to find it..I have attached a log.
>
>
>
> Is there something I should keep in mind while installing CGAL ?
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] CGAL library not found (though installed)

2018-06-21 Thread Alexandre Hannud Abdo
Ni! Hi Ganesh,

`./configure` generates a file called "config.log" when run, that is the
file you want to transmit when asking for help. A copy/paste of your
terminal is not nearly as useful.

Meanwhile, I assume you passed the parameter " --with-cgal=/usr/local/" to
`./configure`, is that right ?

Cheers,
ale
.~´





On Thu, Jun 21, 2018 at 4:23 PM, Srinivasamoorthy, Ganesh (CDC/OID/NCEZID)
(CTR)  wrote:

> I installed CGAL from source and it installed at /usr/local/include/CGAL/
> Then when I try to build graph-tools (both 2.26 and the source from git)
> give me CGAl not found error. They do seem to be checking in the /usr/local
> directory but don't seem to find it..I have attached a log.
>
>
>
> Is there something I should keep in mind while installing CGAL ?
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Most efficient way to access all nodes in a block

2018-06-19 Thread Alexandre Hannud Abdo
Ni! Hi Philipp,

Yes, there are more straightforward paths to the same information:

# get some graph and model it
import graph_tool.all as gt
g = gt.collection.data["celegansneural"]
s = gt.minimize_nested_blockmodel_dl(g)

# get your groups of vertices in a dictionary
l0 = s.levels[0]
block2vertices = dict()
for i in range(l0.B):
block2vertices[i] = gt.find_vertex(l0.g, l0.b, i)

Cheers
.~´


On Tue, Jun 19, 2018 at 7:01 PM, P-M  wrote:

> (I should probably add that I am only interested in relations between the
> nodes in a given block with each other, so am happy to work with vertex
> filters.)
>
>
>
> --
> Sent from: http://main-discussion-list-for-the-graph-tool-project.
> 982480.n3.nabble.com/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] libpython3.5 error on Ubuntu17.10

2018-01-25 Thread Alexandre Hannud Abdo
No problem, glad we got it to work =)
Cheers,
ale
.~´

On Thu, Jan 25, 2018 at 5:09 AM, Snehal Shekatkar <
snehalshekat...@protonmail.com> wrote:

> Hi Alexandre,
>
> Stupid me! I had zesty in the sources.list :(
> Sorry for this and thanks so much for your time.
>
> Snehal
>
>
> Sent with ProtonMail <https://protonmail.com> Secure Email.
>
>  Original Message ----
> On January 25, 2018 12:31 AM, Alexandre Hannud Abdo <a...@member.fsf.org>
> wrote:
>
> Hi Snehal,
>
> I checked the release notes for 17.10 and Python 3.6 is indeed the
> default. You shouldn't need to downgrade it.
>
> Can you check whether your graph-tool line in /etc/apt/sources.list is
> pointing to "artful" and not another release? i.e.:
>
> deb http://downloads.skewed.de/apt/*artful* *artful* universe
>
> If this is correct, there seems to be an issue with how graph-tool was
> compiled for 17.10, in which case you'd have to compile it yourself or wait
> for the package to be fixed.
>
> Cheers,
>
> ale
> .~´
>
>
>
>
>
>
>
>
>
> On Wed, Jan 24, 2018 at 6:02 PM, Snehal Shekatkar <
> snehalshekat...@protonmail.com> wrote:
>
>> Sorry that I didn't provide everything that you asked for. Yes I am
>> installing gt on newly installed Ubuntu17.10 and running `locate
>> libpython`, among other things, gives me:
>>
>> /var/lib/dpkg/info/libpython3-dev:amd64.list
>> /var/lib/dpkg/info/libpython3-dev:amd64.md5sums
>> /var/lib/dpkg/info/libpython3-stdlib:amd64.list
>> /var/lib/dpkg/info/libpython3-stdlib:amd64.md5sums
>> /var/lib/dpkg/info/libpython3.6-dev:amd64.list
>> /var/lib/dpkg/info/libpython3.6-dev:amd64.md5sums
>> /var/lib/dpkg/info/libpython3.6-minimal:amd64.conffiles
>> /var/lib/dpkg/info/libpython3.6-minimal:amd64.list
>> /var/lib/dpkg/info/libpython3.6-minimal:amd64.md5sums
>> /var/lib/dpkg/info/libpython3.6-minimal:amd64.postinst
>> /var/lib/dpkg/info/libpython3.6-minimal:amd64.postrm
>> /var/lib/dpkg/info/libpython3.6-minimal:amd64.prerm
>> /var/lib/dpkg/info/libpython3.6-stdlib:amd64.list
>> /var/lib/dpkg/info/libpython3.6-stdlib:amd64.md5sums
>> /var/lib/dpkg/info/libpython3.6-stdlib:amd64.prerm
>> /var/lib/dpkg/info/libpython3.6:amd64.list
>> /var/lib/dpkg/info/libpython3.6:amd64.md5sums
>> /var/lib/dpkg/info/libpython3.6:amd64.shlibs
>> /var/lib/dpkg/info/libpython3.6:amd64.symbols
>> /var/lib/dpkg/info/libpython3.6:amd64.triggers
>>
>> Thus, the version 3.6 seems to be installed and I guess I need 3.5. Is
>> that right?
>>
>>
>> Sent with ProtonMail <https://protonmail.com> Secure Email.
>>
>>  Original Message 
>> On January 24, 2018 3:59 PM, Alexandre Hannud Abdo <a...@member.fsf.org>
>> wrote:
>>
>> Well, I'll ask again: are you installing on a new clean install of Ubuntu?
>>
>> Also, the package you're having trouble with is not Python, it's
>> libpython. Do you have libpython installed? What version? Did you try
>> reinstalling it?
>>
>> If you don't provide us with detailed information, we can't do much to
>> help you.
>>
>> .~´
>>
>>
>> On Wed, Jan 24, 2018 at 4:51 PM, Snehal Shekatkar <
>> snehalshekat...@protonmail.com> wrote:
>>
>>> Unfortunately, installing Python3.5 didn't help me. Still throws the
>>> same error.
>>>
>>>
>>> Sent with ProtonMail <https://protonmail.com> Secure Email.
>>>
>>>  Original Message 
>>> On January 24, 2018 11:48 AM, Alexandre Hannud Abdo <a...@member.fsf.org>
>>> wrote:
>>>
>>> Ni! Hi Snehal,
>>>
>>> Do you mean you tried this command on a new clean install of Ubuntu,
>>> nothing else been done previously to it? - other than enabling he PPA and
>>> updating the system, I'd guess.
>>>
>>> Otherwise, this may not be related to graph-tool at all, you just need
>>> to figure out why libpython is not installable.
>>>
>>> (Did you already try any solution after searching the net for the error
>>> message? For example, reinstalling python3 and the respective libpython? Or
>>> calling install with aptitude instead of apt?)
>>>
>>> Cheers,
>>> .~'
>>>
>>>
>>> On Wednesday, January 24, 2018, Snehal Shekatkar <
>>> snehalshekat...@gmail.com> wrote:
>>>
>>>> Dear Tiago,
>>>>
>>>> I am trying to install graph-tool on ubuntu17.10 and I get the
>>>> followi

Re: [graph-tool] libpython3.5 error on Ubuntu17.10

2018-01-24 Thread Alexandre Hannud Abdo
Hi Snehal,

I checked the release notes for 17.10 and Python 3.6 is indeed the default.
You shouldn't need to downgrade it.

Can you check whether your graph-tool line in /etc/apt/sources.list is
pointing to "artful" and not another release? i.e.:

deb http://downloads.skewed.de/apt/*artful* *artful* universe

If this is correct, there seems to be an issue with how graph-tool was
compiled for 17.10, in which case you'd have to compile it yourself or wait
for the package to be fixed.

Cheers,

ale
.~´









On Wed, Jan 24, 2018 at 6:02 PM, Snehal Shekatkar <
snehalshekat...@protonmail.com> wrote:

> Sorry that I didn't provide everything that you asked for. Yes I am
> installing gt on newly installed Ubuntu17.10 and running `locate
> libpython`, among other things, gives me:
>
> /var/lib/dpkg/info/libpython3-dev:amd64.list
> /var/lib/dpkg/info/libpython3-dev:amd64.md5sums
> /var/lib/dpkg/info/libpython3-stdlib:amd64.list
> /var/lib/dpkg/info/libpython3-stdlib:amd64.md5sums
> /var/lib/dpkg/info/libpython3.6-dev:amd64.list
> /var/lib/dpkg/info/libpython3.6-dev:amd64.md5sums
> /var/lib/dpkg/info/libpython3.6-minimal:amd64.conffiles
> /var/lib/dpkg/info/libpython3.6-minimal:amd64.list
> /var/lib/dpkg/info/libpython3.6-minimal:amd64.md5sums
> /var/lib/dpkg/info/libpython3.6-minimal:amd64.postinst
> /var/lib/dpkg/info/libpython3.6-minimal:amd64.postrm
> /var/lib/dpkg/info/libpython3.6-minimal:amd64.prerm
> /var/lib/dpkg/info/libpython3.6-stdlib:amd64.list
> /var/lib/dpkg/info/libpython3.6-stdlib:amd64.md5sums
> /var/lib/dpkg/info/libpython3.6-stdlib:amd64.prerm
> /var/lib/dpkg/info/libpython3.6:amd64.list
> /var/lib/dpkg/info/libpython3.6:amd64.md5sums
> /var/lib/dpkg/info/libpython3.6:amd64.shlibs
> /var/lib/dpkg/info/libpython3.6:amd64.symbols
> /var/lib/dpkg/info/libpython3.6:amd64.triggers
>
> Thus, the version 3.6 seems to be installed and I guess I need 3.5. Is
> that right?
>
>
> Sent with ProtonMail <https://protonmail.com> Secure Email.
>
>  Original Message 
> On January 24, 2018 3:59 PM, Alexandre Hannud Abdo <a...@member.fsf.org>
> wrote:
>
> Well, I'll ask again: are you installing on a new clean install of Ubuntu?
>
> Also, the package you're having trouble with is not Python, it's
> libpython. Do you have libpython installed? What version? Did you try
> reinstalling it?
>
> If you don't provide us with detailed information, we can't do much to
> help you.
>
> .~´
>
>
> On Wed, Jan 24, 2018 at 4:51 PM, Snehal Shekatkar <
> snehalshekat...@protonmail.com> wrote:
>
>> Unfortunately, installing Python3.5 didn't help me. Still throws the same
>> error.
>>
>>
>> Sent with ProtonMail <https://protonmail.com> Secure Email.
>>
>>  Original Message 
>> On January 24, 2018 11:48 AM, Alexandre Hannud Abdo <a...@member.fsf.org>
>> wrote:
>>
>> Ni! Hi Snehal,
>>
>> Do you mean you tried this command on a new clean install of Ubuntu,
>> nothing else been done previously to it? - other than enabling he PPA and
>> updating the system, I'd guess.
>>
>> Otherwise, this may not be related to graph-tool at all, you just need to
>> figure out why libpython is not installable.
>>
>> (Did you already try any solution after searching the net for the error
>> message? For example, reinstalling python3 and the respective libpython? Or
>> calling install with aptitude instead of apt?)
>>
>> Cheers,
>> .~'
>>
>>
>> On Wednesday, January 24, 2018, Snehal Shekatkar <
>> snehalshekat...@gmail.com> wrote:
>>
>>> Dear Tiago,
>>>
>>> I am trying to install graph-tool on ubuntu17.10 and I get the following
>>> error:
>>>
>>> sudo apt-get install python3-graph-tool
>>>
>>> The following packages have unmet dependencies:
>>> python3-graph-tool : Depends: libpython3.5 (>= 3.5.0~b1) but it is not
>>> installable
>>> E: Unable to correct problems, you have held broken packages.
>>>
>>> How can I fix this?
>>>
>>> Thank you
>>>
>>> Snehal M. Shekatkar
>>> Pune
>>> India
>>> www.snehalshekatkar.com
>>>
>>
>>
>> ___
>> graph-tool mailing list
>> graph-tool@skewed.de
>> https://lists.skewed.de/mailman/listinfo/graph-tool
>>
>>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] libpython3.5 error on Ubuntu17.10

2018-01-24 Thread Alexandre Hannud Abdo
Well, I'll ask again: are you installing on a new clean install of Ubuntu?

Also, the package you're having trouble with is not Python, it's libpython.
Do you have libpython installed? What version? Did you try reinstalling it?

If you don't provide us with detailed information, we can't do much to help
you.

.~´


On Wed, Jan 24, 2018 at 4:51 PM, Snehal Shekatkar <
snehalshekat...@protonmail.com> wrote:

> Unfortunately, installing Python3.5 didn't help me. Still throws the same
> error.
>
>
> Sent with ProtonMail <https://protonmail.com> Secure Email.
>
>  Original Message 
> On January 24, 2018 11:48 AM, Alexandre Hannud Abdo <a...@member.fsf.org>
> wrote:
>
> Ni! Hi Snehal,
>
> Do you mean you tried this command on a new clean install of Ubuntu,
> nothing else been done previously to it? - other than enabling he PPA and
> updating the system, I'd guess.
>
> Otherwise, this may not be related to graph-tool at all, you just need to
> figure out why libpython is not installable.
>
> (Did you already try any solution after searching the net for the error
> message? For example, reinstalling python3 and the respective libpython? Or
> calling install with aptitude instead of apt?)
>
> Cheers,
> .~'
>
>
> On Wednesday, January 24, 2018, Snehal Shekatkar <
> snehalshekat...@gmail.com> wrote:
>
>> Dear Tiago,
>>
>> I am trying to install graph-tool on ubuntu17.10 and I get the following
>> error:
>>
>> sudo apt-get install python3-graph-tool
>>
>> The following packages have unmet dependencies:
>> python3-graph-tool : Depends: libpython3.5 (>= 3.5.0~b1) but it is not
>> installable
>> E: Unable to correct problems, you have held broken packages.
>>
>> How can I fix this?
>>
>> Thank you
>>
>> Snehal M. Shekatkar
>> Pune
>> India
>> www.snehalshekatkar.com
>>
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


[graph-tool] libpython3.5 error on Ubuntu17.10

2018-01-24 Thread Alexandre Hannud Abdo
Ni! Hi Snehal,

Do you mean you tried this command on a new clean install of Ubuntu,
nothing else been done previously to it? - other than enabling he PPA and
updating the system, I'd guess.

Otherwise, this may not be related to graph-tool at all, you just need to
figure out why libpython is not installable.

(Did you already try any solution after searching the net for the error
message? For example, reinstalling python3 and the respective libpython? Or
calling install with aptitude instead of apt?)

Cheers,
.~'


On Wednesday, January 24, 2018, Snehal Shekatkar 
wrote:

> Dear Tiago,
>
> I am trying to install graph-tool on ubuntu17.10 and I get the following
> error:
>
> sudo apt-get install python3-graph-tool
>
> The following packages have unmet dependencies:
> python3-graph-tool : Depends: libpython3.5 (>= 3.5.0~b1) but it is not
> installable
> E: Unable to correct problems, you have held broken packages.
>
> How can I fix this?
>
> Thank you
>
> Snehal M. Shekatkar
> Pune
> India
> www.snehalshekatkar.com
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Displaying Overlapping Communities for Networks Without Clustering with SBMs

2017-10-05 Thread Alexandre Hannud Abdo
You're probably just passing the wrong type to vertex_pie_fractions, but we
have no way to know that as we're missing the minimal self-contained
example.

.~´

On Thu, Oct 5, 2017 at 11:54 AM, isukritgupta 
wrote:

> Hi, I am trying to generate plots for communities detected by another
> algorithm (outside graph-tool). The communities are overlapping and I
> wanted
> to display something like nodes with multiple colors (like we have for
> SBMs). For this I set a new vertex property and assign nodal memberships to
> it. I assign a matrix which contains one hot vectors for each node's
> community membership. So the matrix has shape n x g where n is the number
> of
> nodes and g is the number of communities. When I use graph_draw like:
>
> graph_draw(g, vertex_shape="pie", vertex_pie_fractions=pv,
> edge_gradient=None, output="lesmis-sbm-marginals.svg")
>
> where pv is the property map, I get: python3:
> ../../../../src/cairo-arc.c:189: _cairo_arc_in_direction: Assertion
> `angle_max >= angle_min' failed.
>
> I want to show overlapping clusters with graph-tool, but the clustering
> hasn't been performed by graph-tool.
>
> Any ideas as to how to go about this?
>
> Thanks!
>
>
>
>
> --
> Sent from: http://main-discussion-list-for-the-graph-tool-project.
> 982480.n3.nabble.com/
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] How to effectively get the nested blockmodel block memberships of each of the nodes in your graph

2017-08-05 Thread Alexandre Hannud Abdo
Ni!

What you're looking for is the 'project_level' method of NestedBlockState:

some_level = 2
blocks = state.project_level( some_level ).get_blocks()
block_for_v_at_level = blocks[ some_vertex ]

Hope this helps,

ale
.~´



On Sat, Aug 5, 2017 at 5:29 PM, lenail  wrote:

> Hello Graph Tool developers,
>
> I'm interested in the nested stochastic block model (nsbm). What interests
> me most is: when I fit the model, where did each of my nodes get clustered?
> The closest function I can find to this in the API by reading the docs is:
>
> nsbm.get_bs()
>
> which returns
>
>
> [PropertyArray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int32),
>  PropertyArray([1, 1, 2, 2, 3, 4, 5, 0, 6, 4, 7, 1, 1, 4, 0, 5, 0, 0, 8, 2,
> 6, 5, 6, 6, 2, 2, 3, 3, 1, 1, 0, 7, 5, 5, 7, 3, 3, 6, 3, 7,
> 9, 8, 0, 8, 6, 7, 7], dtype=int32),
>  PropertyArray([ 0,  1,  1, 13,  4,  5,  6,  7,  8,  9, 10,  4, 11,  0, 12,
> 13, 10, 14, 15,  4, 16, 17, 18,  5, 19, 20, 21, 22, 23,  9,
> 16, 14,  7, 24, 25, 26,  9, 27, 28, 29, 30,  5, 35, 14, 23,
> 30, 11, 41, 31, 13, 32,  6, 25, 33,  8, 34,  0, 12,  4, 16,
> 32, 35,  0, 28, 36, 13, 30, 27, 36, 11, 19, 13, 26, 13, 36,
> 37, 23, 28, 32, 19, 25, 29,  5, 24, 20, 27, 25,  4, 17, 36,
> 22, 11, 15, 12, 14,  2,  5, 38,  9,  9, 24, 39, 29, 13, 34,
> 17,  8, 20,  9,  5, 23,  8,  9, 40, 40, 27, 31, 40, 41, 10,
>  3, 12, 25, 38, 20, 40,  9,  9, 25, 42, 10, 24, 43,  3, 37,
>  2, 17, 34, 35, 21, 38, 32, 26, 22, 28, 13, 17, 44, 45, 36,
> 42, 26, 17, 27, 24, 40, 39,  9, 13,  5, 43, 38, 35, 30, 13,
> 36, 13, 11, 14, 40, 40, 12,  3, 40, 38,  1, 40, 21, 42,  9,
> 10, 29, 43, 45, 40, 31, 46, 40, 31,  5, 42, 40, 14, 11, 38,
> 34, 31, 34, 40, 31, 31, 45, 10,  4], dtype=int32),
>  PropertyArray([  0,   1,   2, ..., 163,  98,  18], dtype=int32)]
>
>
> The solution I ended up using was:
>
>
> vertex_name = nsbm.g.vertex_properties['_graphml_vertex_id']
>
> clustering = [(nsbm.g.vertex_index[v], vertex_name[v],
> nsbm.get_bs()[0][nsbm.g.vertex_index[v]]) for v in nsbm.g.vertices()]
>
> clustering = [(i, name, base_clustering, nsbm.get_bs()[1][level0]) for i,
> name, level0 in clustering]
>
> clustering = [(i, name, level0, level1, nsbm.get_bs()[2][level1]) for i,
> name, level0, level1 in clustering]
>
> clustering = [(i, name, level0, level1, level2, nsbm.get_bs()[3][level2])
> for i, name, level0, level1, level2 in clustering]
>
>
> at which point I had my result. Is there a less verbose way of putting
> this?
> If not, this serves as a feature request to add such a method, maybe called
> "get_clabels" ?
>
>
>
> --
> View this message in context: http://main-discussion-list-
> for-the-graph-tool-project.982480.n3.nabble.com/How-to-
> effectively-get-the-nested-blockmodel-block-memberships-
> of-each-of-the-nodes-in-your-graph-tp4027329.html
> Sent from the Main discussion list for the graph-tool project mailing list
> archive at Nabble.com.
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Unable to use subplots with mplfig

2017-07-29 Thread Alexandre Hannud Abdo
Funny thing, messing around with your example I find that graph_draw seems
to be drawing onto the wrong axis: when you pass axis 3 it draws inside
aixs 1, passing axis 4 draws inside axis 2, and what you pass as axes 1 and
2 is likely being drawn outside the canvas. Also, if you exapnd to 8 axes,
it plots only 4 of them, so it seems things are being shifted halfway
updards before drawing. I looked at the code but having never played with
Cairo it is not evident what could be wrong, but hopefully this will help.

.~´


On Sat, Jul 29, 2017 at 6:25 AM, Snehal Shekatkar  wrote:

> Can somebody kindly help me with this? I am completely stuck.
>
> Thank you
>
>
> On Thu, Jul 27, 2017 at 2:12 PM, Snehal Shekatkar <
> snehalshekat...@gmail.com> wrote:
>
>> Hello all,
>>
>> I am trying to use mplfig parameter of the graph_draw to draw 4 graphs on
>> the same plot. My code is given below. However, this only produces graphs
>> in first and second subplots. What am I missing?
>>
>> import graph_tool.all as gt
>> import matplotlib.pyplot as plt
>> plt.switch_backend('cairo')
>>
>> '''Load a graph'''
>> g = gt.collection.data['karate']
>>
>> for ind in range(4):
>>
>> ax = plt.subplot(2, 2, ind+1)
>> gt.graph_draw(g, mplfig = ax)
>>
>> plt.savefig('karate4states.pdf')
>>
>>
>> Thank you
>>
>> --
>> Snehal M. Shekatkar
>> Pune
>> India
>>
>
>
>
> --
> Snehal M. Shekatkar
> Pune
> India
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Can't compile graph-tool on Solus, not enough RAM

2017-06-28 Thread Alexandre Hannud Abdo
Ni! Hi Padraig,

Some things which might help us help you:

a) gcc version you're using
b) graph-tool version you're compiling
c) how much ram do you actually have available when you start your
compilation
d) the actual error message coming out of gcc

cheers,

ale
.~´


On Wed, Jun 28, 2017 at 12:34 PM, padraigmac 
wrote:

> I have a laptop with 8GB RAM and 6GB swap yet when I try to make graph-tool
> it always runs out of RAM while compiling graph_blockmodel.hh:236:2
> If I try with GCC it gives usually is killed but sometimes restarts the
> computer, if I try with clang it restarts the computer.
>
> I'm using Solus as my distro.
>
>
>
> --
> View this message in context: http://main-discussion-list-
> for-the-graph-tool-project.982480.n3.nabble.com/Can-t-
> compile-graph-tool-on-Solus-not-enough-RAM-tp4027271.html
> Sent from the Main discussion list for the graph-tool project mailing list
> archive at Nabble.com.
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Takes enormous memory and then eventually gets terminated.

2017-05-30 Thread Alexandre Hannud Abdo
Hi Isuki,

No, that is not expected.

We'll need more information to help you, can you provide at least:

1. graph-tool version you're using
3. the graph, exported by graph-tool
2. a minimal script that reproduces the issue

Cheers,
ale
.~´

Le mardi 30 mai 2017 à 02:13 -0700, isukritgupta a écrit :
> Hi, I have a graph with around 9500 nodes and 37000 edges. I want to
> determine the SBM corresponding to this network, but when I run
> minimize_blockmodel_dl function on it, I get a 'killed:9' error. I
> checked
> the memory consumption and it exceeded 50 GB at one point. 
> 
> Is this expected? Or is there something I am doing wrong?
> 
> 
> 
> --
> View this message in context: http://main-discussion-list-for-the-gra
> ph-tool-project.982480.n3.nabble.com/Takes-enormous-memory-and-then-
> eventually-gets-terminated-tp4027236.html
> Sent from the Main discussion list for the graph-tool project mailing
> list archive at Nabble.com.
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Correlation Histogram

2017-02-09 Thread Alexandre Hannud Abdo
Well, yes. Though you can configure your shell and make it permanent.
Software Carpentry has some good tutorials on using the shell, for example:

http://swcarpentry.github.io/shell-extras/08-environment-variables.html

You can also modify the environment from within Python, using the
"os.environ" dictionary. You'll just have to set the value for
'OMP_NUM_THREADS' before importing graph-tool, because openmp will consider
the value at the time of importing.

[]s

On Thursday, February 9, 2017, P-M  wrote:

> Thanks! I presume this won't impact already running processes and is only
> valid for as long as my instance of PuTTY is running and after that revert
> to normal?
>
>
>
> --
> View this message in context: http://main-discussion-list-fo
> r-the-graph-tool-project.982480.n3.nabble.com/Correlation-
> Histogram-Runs-out-of-RAM-tp4027010p4027012.html
> Sent from the Main discussion list for the graph-tool project mailing list
> archive at Nabble.com.
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


[graph-tool] general "did not match C++ signature" error

2017-01-31 Thread Alexandre Hannud Abdo
Ni !

The import working means that Python can find the Python component of graph
tool.

The error you get has to do with boost Python not finding, for a call
internal to the Python component, a corresponding function in the C++
component that matches it's argument types.

Thus, this happens if any of the pieces involved do not match. A common
cause is version mismatch.

Ldd is useful to check some of those: the versions of libraries linked to
the C++ component.

In your led output I see

libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0 (0x738ce000)

Thus it seems to be the case that the package got compiled against Python
2.6, yet got installed for Python 2.7 .

Cheers

ale

On Sunday, January 29, 2017, bloodymeli > wrote:

> Hi,
>
> Graph-tool was manually compiled on a local cluster (based on RedHat) by a
> network admin. The python command
> import graph_tool
> works fine, but almost every other command results in an error related to
> "did not match C++ signature":
> For example,
> gtGraph=graph_tool.load_graph("yeast.graphml")
> (attached) results in:
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/local/epd/lib/python2.7/site-packages/graph_tool/__ini
> t__.py",
> line 2702, in load_graph
> g.load(file_name, fmt, ignore_vp, ignore_ep, ignore_gp)
>   File "/usr/local/epd/lib/python2.7/site-packages/graph_tool/__ini
> t__.py",
> line 2320, in load
> ignore_ep, ignore_gp)
> Boost.Python.ArgumentError: Python argument types in
> GraphInterface.read_from_file(GraphInterface, str, NoneType, str,
> list,
> list, list)
> did not match C++ signature:
> read_from_file(graph_tool::GraphInterface {lvalue},
> std::__cxx11::basic_string,
> std::allocator >, boost::python::api::object,
> std::__cxx11::basic_string,
> std::allocator >, boost::python::list, boost::python::list,
> boost::python::list)
>
> Following some other posts in the mailing list, I've applied the ldd
> command
> and:
> ldd
> /usr/local/epd/lib/python2.7/site-packages/graph_tool/libgra
> ph_tool_core.so
> linux-vdso.so.1 =>  (0x77ffe000)
> libboost_iostreams.so.1.59.0 => /usr/lib64/libboost_iostreams.
> so.1.59.0
> (0x75c46000)
> libboost_python.so.5 => /usr/lib64/libboost_python.so.5
> (0x759f5000)
> libboost_regex.so.1.59.0 => /usr/lib64/libboost_regex.so.1.59.0
> (0x756df000)
> libboost_coroutine.so.1.59.0 => /usr/lib64/libboost_coroutine.
> so.1.59.0
> (0x754d4000)
> libCGAL.so.12 =>
> /usr/local/cgal-releases-CGAL-4.9/build/release/lib/libCGAL.so.12
> (0x752af000)
> libexpat.so.1 => /lib64/libexpat.so.1 (0x75087000)
> libstdc++.so.6 =>
> /usr/local/gcc5.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.
> 3.0/../../../../lib64/libstdc++.so.6
> (0x74cf8000)
> libm.so.6 => /lib64/libm.so.6 (0x74a74000)
> libc.so.6 => /lib64/libc.so.6 (0x746e)
> libgcc_s.so.1 =>
> /usr/local/gcc5.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.
> 3.0/../../../../lib64/libgcc_s.so.1
> (0x744c9000)
> libbz2.so.1 => /lib64/libbz2.so.1 (0x742b8000)
> libz.so.1 => /usr/local/epd/lib/libz.so.1 (0x7409a000)
> librt.so.1 => /lib64/librt.so.1 (0x73e91000)
> libpthread.so.0 => /lib64/libpthread.so.0 (0x73c74000)
> libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0
> (0x738ce000)
> libicudata.so.42 => /usr/lib64/libicudata.so.42
> (0x72788000)
> libicui18n.so.42 => /usr/lib64/libicui18n.so.42
> (0x723f2000)
> libicuuc.so.42 => /usr/lib64/libicuuc.so.42 (0x720a)
> libboost_context.so.1.59.0 => /usr/lib64/libboost_context.so
> .1.59.0
> (0x71e96000)
> libboost_thread.so.1.59.0 => /usr/lib64/libboost_thread.so.1.59.0
> (0x71c74000)
> libboost_chrono.so.1.59.0 => /usr/lib64/libboost_chrono.so.1.59.0
> (0x71a6d000)
> libboost_system.so.1.59.0 => /usr/lib64/libboost_system.so.1.59.0
> (0x71869000)
> libmpfr.so.1 => /usr/lib64/libmpfr.so.1 (0x7161c000)
> libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x713c1000)
> /lib64/ld-linux-x86-64.so.2 (0x003f1480)
> libdl.so.2 => /lib64/libdl.so.2 (0x711bc000)
> libutil.so.1 => /lib64/libutil.so.1 (0x70fb9000)
>
> yeast.graphml
>  80.n3.nabble.com/file/n4026983/yeast.graphml>
>
>
>
> --
> View this message in context: http://main-discussion-list-fo
> r-the-graph-tool-project.982480.n3.nabble.com/general-did-
> not-match-C-signature-error-tp4026983.html
> Sent from the Main discussion list for the graph-tool project mailing list
> archive at Nabble.com.
> 

Re: [graph-tool] Average neighbour-neighbour correlation

2017-01-08 Thread Alexandre Hannud Abdo
Ni!

avg_neighbour_corr considers as neighbours of v the targets of edges
for which v is source.

The documentation on the website already states this correlation in
terms of 'source' and 'target', and in any case it is pretty
straightforward to check what it is doing... but if you want to dig it
you'll end up looking at a c++ class called GetNeighboursPairs.

Generally, you should usually expect directedness to be respected, and
either use g.set_directed() or a GraphView if you want to treat the
graph as undirected for some measure.

If you need to correlate a directed measure while treating the graph as
undirected, for example for avg_neighbour_corr to correlate in-degrees
disregarding edge direction, create a property map to record the
directed measure, then turn the graph into undirected and run the
correlation for the recorded property.

Hope this helps,

[]s

Le vendredi 06 janvier 2017 à 11:44 -0700, P-M a écrit :
> I was wondering, how does avg_neighbour_corr define a neighbour? More
> specifically, if I look at "out" "out" correlation, does graph-tool
> look at
> all neighbours of a given vertex or only at those which are connected
> by an
> outgoing edge from the source vertex?
> 
> Best,
> 
> Philipp
> 
> 
> 
> --
> View this message in context: http://main-discussion-list-for-the-gra
> ph-tool-project.982480.n3.nabble.com/Average-neighbour-neighbour-
> correlation-tp4026940.html
> Sent from the Main discussion list for the graph-tool project mailing
> list archive at Nabble.com.
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Installation of graph-tool-2.19 fails on RedHat 6.5

2016-12-07 Thread Alexandre Hannud Abdo
Le mardi 06 décembre 2016 à 06:16 -0700, Amihai a écrit :
> ./configure CPPFLAGS="-I/usr/include/cairomm-1.0/cairomm/"
> 
> graph_cairo_draw.cc:38:29: fatal error: cairomm/context.h: No such
> file or directory

Hm, did you try passing
CPPFLAGS="-I/usr/include/cairomm-1.0/"
?

The code seems to be looking for "cairomm/context.h", not for
"context.h".

Cheers!

.~´
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Eigenvector centrality runtime/complexity

2016-07-27 Thread Alexandre Hannud Abdo
Hi Philipp,

Not with the sample you provided.

Trying here, time decreases below that for the original graph.

(I had to change the sample to increase n and sample size, otherwise it was
just too fast to capture)

In [1]: %paste

import random
import graph_tool.all as gt
n=10
g = gt.price_network(n,10,directed=False)
%time gt.eigenvector(g)
def node_sample(g, g_vertices, n_samples):
return random.sample(g_vertices, n_samples)
sample = node_sample(g, [x for x in g.vertices()], int(n/10))
vfilt = g.new_vertex_property('bool')
for s in sample:
vfilt[s] = True
g_sample = gt.GraphView(g, vfilt=vfilt)
%time gt.eigenvector(g_sample)
u = gt.Graph(g_sample, prune=True)
%time gt.eigenvector(u)

## -- End pasted text --
CPU times: user 747 ms, sys: 0 ns, total: 747 ms
Wall time: 748 ms
CPU times: user 12.2 s, sys: 0 ns, total: 12.2 s
Wall time: 12.2 s
CPU times: user 335 ms, sys: 0 ns, total: 335 ms
Wall time: 335 ms

Cheers
.~´



On Wed, Jul 27, 2016 at 5:35 PM, Philipp Singer  wrote:

> Thanks for the hint, I tried that but it is the same runtime as on the
> filtered graph.
>
> Best, Philipp
> On 27.07.2016 17:16, Tiago de Paula Peixoto wrote:
>
> On 27.07.2016 17:06, Philipp Singer wrote:
>
> g = gt.price_network(1,10,directed=False)
> %time gt.eigenvector(g)
>
> def node_sample(g, g_vertices, n_samples):
> return random.sample(g_vertices, n_samples)
> sample = node_sample(g, [x for x in g.vertices()], 1000)
>
> vfilt = g.new_vertex_property('bool')
> for s in sample:
> vfilt[s] = True
> g_sample = gt.GraphView(g, vfilt=vfilt)
>
> %time gt.eigenvector(g_sample)
>
> If you want to check if the difference is due to graph filtering, you
> can compare with:
>
> u = gt.Graph(g_sample, prune=True)
> gt.eigenvector(u)
>
> Best,
> Tiago
>
>
>
>
> ___
> graph-tool mailing 
> listgraph-tool@skewed.dehttps://lists.skewed.de/mailman/listinfo/graph-tool
>
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Eigenvector centrality runtime/complexity

2016-07-27 Thread Alexandre Hannud Abdo
HI Philipp,

Can you provide minimal sample code that demonstrates your observations?

That usually improves tenfold the chance that anyone will be able to help.

Cheers,
ale

On Wed, Jul 27, 2016 at 3:14 PM, Philipp Singer  wrote:

> Hi all,
>
> I have run into a runtime/complexity question where I am wondering if
> someone can give me insights into why this might happen.
>
> I have conducted the following steps:
>
> 1.) Create some random network
> 2.) Calculate eigenvector centrality
> 3.) Sample 10% random nodes
> 4.) Filter graph by nodes
> 5.) Calculate eigenvector centrality on sample
>
> I have observed that for the sample, the eigenvector centrality
> calculation takes much longer, in some cases (dependent e.g., on block
> structure) it takes way longer (like 30 times longer).
>
> I am now trying to figure out why this is the case. I assume it has
> something to do with the convergence which might be probably because links
> are missing in the sample. If I do the same for e.g., PageRank the
> difference is not that drastic (it still takes longer in the sample).
>
> Does anyone have an idea what is going on here?
>
> Thanks,
> Philipp
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Extract a neighborhood of a randomly selected node

2016-05-06 Thread Alexandre Hannud Abdo
Hi jimmy/gogurt,

The predecessor graph, returned by predecessor_tree, contains all the nodes
from the original graph, and edges representing the predecessor
relationships given by the map.

In any case, understand that normally you should not have to create an
intermediate graph in order to filter a graph, since you can just use the
information you had to begin with to directly build the filter.

In your case, notice that to get the information you need you don't need
the predecessor map, just the distance map which always gets returned by
shortest_distance.

The logic being: all vertices reached by shortest_distance get a distance
attributed which is an integer smaller than the size of the graph,
otherwise they get attributed an "impossible" distance which is larger than
the size of the graph.

(In your case the vertices of interest have distance of less or equal to 2,
but as you already tell shortest_distance to stop at distance 2, any vertex
that has a higher distance will still be mapped to the "impossible"
distance, so we can just compare the distance to the size of the graph.)

All you have to do is create a new property and assign values to it
according to what you find in the distance map:

g = gt.Graph()

v = g.vertex( random.randint( 0, g.num_vertices() ) )

dmap = gt.shortest_distance( g, source=v, max_dist=2 )

mymap = g.new_vertex_property( 'bool' )

for w in g.vertices():
  if dmap[w] < g.num_vertices():
mymap[w] = True

Now you can use mymap in GraphView.

I haven't actually ran the code so there might be typos.
Good luck and have fun!

Abraços,
l
e
.~´


On Fri, May 6, 2016 at 11:02 PM, gogurt  wrote:

> Hi all,
>
> I have a pretty large graph G from which want to do the following:
>
> 1) Randomly select a node from G
> 2) Get the vertices that lie within radius 2 of the node
> 3) Extract the subgraph induced by those vertices
>
> My code for doing this is the following:
> /
> randnode = random.randint(0,G.num_vertices())
>
> pred_map = gt.shortest_distance(G, source=G.vertex(randnode), max_dist=2,
> pred_map=True)
> pred_tree = gt.predecessor_tree(G, pred_map[1])
>
> # DEBUG
> #print(pred_tree.num_vertices())
>
> verts = pred_tree.vertices()
> vmap = G.new_vertex_property('bool')
> for i in verts:
> vmap[G.vertex_index[i]] = True
> /
>
> Then using vmap, I plan to do a GraphView on G and get the subgraph. But
> something is clearly going wrong here. If I uncomment the line under the #
> DEBUG comment, then I clearly see that pred_tree always has the same number
> of vertices as the original graph.
>
> Am I missing something about how predecessor_tree() works? I expected it to
> only return a subgraph of the original graph, which should have a lot fewer
> vertices...
>
>
>
> --
> View this message in context:
> http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Extract-a-neighborhood-of-a-randomly-selected-node-tp4026565.html
> Sent from the Main discussion list for the graph-tool project mailing list
> archive at Nabble.com.
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] First question - Planarity

2016-04-24 Thread Alexandre Hannud Abdo
Cool!

Hey, the link to the boost reference in the documentation doesn't
work, I think the correct link would be:

http://www.boost.org/doc/libs/release/libs/graph/doc/straight_line_drawing.html

Ni!
ale


On Sun, Apr 24, 2016 at 9:48 PM, Tiago de Paula Peixoto  wrote:
> On 20.04.2016 17:01, Tiago de Paula Peixoto wrote:
>> On 20.04.2016 14:20, Matyas, Csongor wrote:
>>> I will also post my first question, this was the main reason why I 
>>> registered for this mailing list. The description and examples were usually 
>>> more than enough for me to use graph_tool, nice job ;) I have a question 
>>> though.
>>> In the "|graph_tool.topology.||is_planar|(/g/, /embedding=True///)" how do 
>>> I use the embedding information to print my graphs planar. Do I have to do 
>>> that for myself, or there is a built in function that I didn't find? Do I 
>>> have to add the edges following the order that they come using the 
>>> embedding somehow?
>>
>> Here is one way it can be used to draw the graph:
>>
>>  
>> http://www.boost.org/doc/libs/1_60_0/libs/graph/doc/straight_line_drawing.html
>>
>> However, this function is not yet implemented in graph-tool.
>
> FYI, I have just added this functionality to graph-tool:
>
>  
> https://graph-tool.skewed.de/static/doc/dev/draw.html#graph_tool.draw.planar_layout
>
> Best,
> Tiago
>
> --
> Tiago de Paula Peixoto 
>
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Installation under Ubuntu 14

2016-04-13 Thread Alexandre Hannud Abdo
https://graph-tool.skewed.de/download#debian

On Wed, Apr 13, 2016 at 7:43 PM, Yannis Haralambous
 wrote:
>> An internal compiler error is always a compiler bug, it is not
>> graph-tool's fault.
>>
> It was a memory problem, by allowing 2 GB of RAM I had much more *.lo files 
> compiled, but still got the internal error.
> With 3072 MB I got the ones in centrality, clustering, community_old, 
> correlations, draw, flow, generation, inference
> but not any further (and it took hours!)
> Is there some way to compile those .lo file groups separately?
>
>> Le 13 avr. 2016 à 18:59, Tiago de Paula Peixoto  a écrit :
>>
>> As I said before, I recommend you simply install the available binary
>> package for Ubuntu 14.
>
> Do you have an Ubuntu graph-tool binary package?
> Synaptic couldn't locate it.
> Can you give me the name and repository?
>
> --
> ---
> Yannis Haralambous
> Professor
> Institut Mines-Télécom, Télécom Bretagne
> Computer Science Department
> UMR CNRS 6285 Lab-STICC
> Technopôle Brest Iroise
> CS 83818, 29238 Brest Cedex 3, France
> Email: yannis.haralamb...@telecom-bretagne.eu
> Internet: http://perso.telecom-bretagne.eu/yannisharalambous/
> ICBM address: 48°21'31.57"N 4°34'16.76"W
> Twitter: y_haralambous
> ---
> ...the ball I threw while playing in the park
> has not yet reached the ground
> (Dylan Thomas)
>
> Es gab eine Zeit, wo ich nur ungern über Schubert sprechen,
> nur Nächtens den Bäumen und Sternen von ihm vorerzählen mögen.
> (Robert Schumann)
>
> ___
> graph-tool mailing list
> graph-tool@skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Most efficient way to model an epidemic?

2015-08-20 Thread Alexandre Hannud Abdo
Hi gogurt,

It seems you can keep the state of vertices in a boolean property map and
queue the vertices whose neighbors you gotta visit in a python list.

[]s
ale

On Thu, Aug 20, 2015 at 3:40 PM, gogurt gog...@gmail.com wrote:

 Hi all,

 So I've scoured the documentation for this but I've been indoctrinated in
 the ways of NetworkX, so I'm pretty confused.

 I want to implement a simple discrete-time epidemic process on a network.
 For example, starting out with one infected vertex, I want to explore all
 its out-neighbors and infect those with probability p, and then the
 neighbors of those out-neighbors, etc. Once you're infected, you are
 infected forever.

 The way I've done this in NetworkX is to essentially keep track of 3 lists
 of nodes (infected, active, unexplored) and update them in a simple loop.
 Then at the end of the process when the epidemic dies or hits a threshold,
 I
 just subset the graph and get the subgraph which represents the path of the
 infection.

 *My question is: *what's the most efficient way to do this using
 graph-tool?

 At first I thought the same approach (subsetting vertices, which would mean
 working with vertex iterables) would be the fastest way, but then I thought
 maybe working on the original graph with a vertex PropertyMap would be
 better. But my intuition is extremely poor on this (e.g. is it even
 possible
 to subset vertices in a graph based on their values in a PropertyMap
 object?). Any pointers?



 --
 View this message in context:
 http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Most-efficient-way-to-model-an-epidemic-tp4026245.html
 Sent from the Main discussion list for the graph-tool project mailing list
 archive at Nabble.com.
 ___
 graph-tool mailing list
 graph-tool@skewed.de
 http://lists.skewed.de/mailman/listinfo/graph-tool

___
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Animations with graph-tool

2013-01-04 Thread Alexandre Hannud Abdo
On 01/04/2013 08:53 AM, Tiago de Paula Peixoto wrote:
 I've just included a section in the documentation on how to do
 animations with graph-tool:
 
 http://projects.skewed.de/graph-tool/doc/dev/demos/animation.html

terrific!

[]s

ale

___
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Problems installing

2012-11-15 Thread Alexandre Hannud Abdo
Ni!

Hi Hugo,

Your config.log very likely has a more useful description of the issue.

Take a look and share it here.

Good luck,

q.

On 15-11-2012 10:40, Hugo Leeney wrote:
 Oh sorry, I have a bunch of log outputs on my terminal - I just picked
 the wrong one. I have been permutating versions ... I get the same
 result in 2.72.

___
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Welcome to the graph-tool mailing list

2012-10-17 Thread Alexandre Hannud Abdo
On 17-10-2012 18:13, Ronnie Ghose wrote:
 Sorry i'm new here. Is the code hosted on github?
 

Hi Ronnie, and welcome.

Yes, there is a github repository mirroring the main repository which is
located at skewed.de.

Take a look at the last section in

http://projects.skewed.de/graph-tool/wiki/GraphToolDownload

as it has all the details. (just scroll to the bottom of the page)

Happy hacking,

Ni!
___
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool