subgraph_isomorphism (getting values)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

subgraph_isomorphism (getting values)

malwanain
I'me using subgraph isomorphism which comparing two graphs and the result is as follows:

>>> print(subgraph_isomorphism(a, b))
[<PropertyMap object with key type 'Vertex' and value type 'int32_t', for Graph 0x10f52ff10, at 0x11e6eedd0, with values:
[ 0  1  2  3  4  6  7  8  9 10  5]>, <PropertyMap object with key type 'Vertex' and value type 'int32_t', for Graph 0x10f52ff10, at 0x11e6eea10, with values:
[ 0  1  2  3  4  6  7  8  9 10 11]>]

My question is that is there any way to get full information about these numbers?(Vertex name or something)?

regards
Reply | Threaded
Open this post in threaded view
|

Re: subgraph_isomorphism (getting values)

Tiago Peixoto
Administrator
On 29.01.2015 12:39, malwanain wrote:

> I'me using subgraph isomorphism which comparing two graphs and the result is
> as follows:
>
>>>> print(subgraph_isomorphism(a, b))
> [<PropertyMap object with key type 'Vertex' and value type 'int32_t', for
> Graph 0x10f52ff10, at 0x11e6eedd0, with values:
> [ 0  1  2  3  4  6  7  8  9 10  5]>, <PropertyMap object with key type
> 'Vertex' and value type 'int32_t', for Graph 0x10f52ff10, at 0x11e6eea10,
> with values:
> [ 0  1  2  3  4  6  7  8  9 10 11]>]
>
> My question is that is there any way to get full information about these
> numbers?(Vertex name or something)?
Yes, of course. Please take a look at the documentation:

     http://graph-tool.skewed.de/static/doc/quickstart.html

so that you are familiar with the basic concepts of the library. It is
usually a good idea to do so before asking questions on the list.

The numbers in the properties returned by the subgraph_isomorphism()
function are vertex indexes. You can get a vertex object corresponding
to an index as follows:

      v = g.vertex(idx)

where 'idx' is the index value.

Best,
Tiago

--
Tiago de Paula Peixoto <[hidden email]>


_______________________________________________
graph-tool mailing list
[hidden email]
http://lists.skewed.de/mailman/listinfo/graph-tool

signature.asc (836 bytes) Download Attachment
--
Tiago de Paula Peixoto <tiago@skewed.de>