igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Accessing the isomorphisms returned by igraph_get_isomorph


From: Jyothish Soman
Subject: Re: [igraph] Accessing the isomorphisms returned by igraph_get_isomorphisms_vf2
Date: Mon, 2 Mar 2009 12:18:52 +0530

This is code i wrote for some other purpose, but i suppose will work here.


int n,i,k;
long int temp;
        n=igraph_vector_ptr_size(&maps);
        for(i=0;i<n;i++)
        {
                igraph_vector_t *v;
                v=igraph_vector_ptr_e(&maps,i);          //v will store each of the permutations.
          
                        for(k=0;k<igraph_vector_size(v);k++)
                        {
                                temp=(long int)VECTOR(*v)[k];            //here temp will take out each component from the vector
                               
                        }
               
        }
**To rest of the community: This is my first reply here**

On Mon, Mar 2, 2009 at 11:47 AM, Mark McClure <address@hidden> wrote:
How can I access the isomorphisms returned by
igraph_get_isomorphisms_vf2 (and presumably related
functions)?  Evidently, they're stored in a pointer
to an igraph_vector_ptr_t, but I've no idea how to
access the individual mappings as lists.

Here's a simplified snippet of what I've got so far:

----------------
// Create a complete graph on 3 vertices.
igraph_real_t edges[] = { 0, 1, 1, 2, 2, 0 };
igraph_vector_view(&v, edges, sizeof(edges)/sizeof(double));
igraph_create(&graph, &v, 0, IGRAPH_UNDIRECTED);

igraph_vector_ptr_t maps;
igraph_vector_ptr_init(&maps, 1);
int status = igraph_get_isomorphisms_vf2(&graph, &graph, &maps);
int size = igraph_vector_ptr_size(&maps);
------------------

At this point, I guess the mappings are stored in maps.  Also,
my status variable returns 0 and size returns 6; I guess these
are both good.  But again, how can I access the actual
permutations? 

Thanks for any assistance,
Mark McClure


_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help




--
JYOTHISH SOMAN

--------------------------------------------------------------
The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
   George Bernard Shaw
--------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]