Giter Site home page Giter Site logo

Comments (6)

anadon avatar anadon commented on July 21, 2024

get two iterators and cycle from one to the other to find an edge with index i

Please clarify

convert it to g1's local edge descriptor

One reason why I want to replace BGL.

So are you saying that the edge between two vertices in a subgraph is not the same edge as between those two vertices in the full graph?

from graph.

kenkangxgwe avatar kenkangxgwe commented on July 21, 2024

get two iterators and cycle from one to the other to find an edge with index i

    typename subgraph_t::edge_iterator e1_i, e1_i_end;
    typename subgraph_t::edge_descriptor ed1;
    for(tie(e1_i, e1_i_end) = edges(g1); e1_i != e1_i_end; ++e1_i)
    {
        if(get(boost::edge_index, g1, /* index */ 1) {
            ed1 = *e1_i;
        }
    }

Try this if you get a segmentation fault:

template<typename subgraph_t>
void global_local_convertion_test(subgraph_t &g)
{
    subgraph_t &r_g = g.root();
    typename subgraph_t::edge_iterator er_i, er_i_end;
    for(tie(er_i, er_i_end) = edges(r_g); er_i != er_i_end; ++er_i)
    {
        if(get(boost::edge_index, r_g, *er_i) == 1)
        {
            g[g.global_to_local(*er_i)];
        }
    }
    typename subgraph_t::const_children_iterator gi, gi_end;
    boost::tie(gi, gi_end) = g.children();
    for(; gi != gi_end; ++gi)
    {
        global_local_convertion_test(*gi);
    }
}

from graph.

kenkangxgwe avatar kenkangxgwe commented on July 21, 2024

So are you saying that the edge between two vertices in a subgraph is not the same edge as between those two vertices in the full graph?

I tried to say the edge between two vertices in a subgraph is not the same edge as the edge between the same two vertices full graph after I convert it from global to local

from graph.

anadon avatar anadon commented on July 21, 2024

That global to local might be to have alternate sets of edges in subgraphs. I'll check it out.

Please provide the output from valgrind running your test case in a gist.

from graph.

anadon avatar anadon commented on July 21, 2024
    edge_descriptor global_to_local(edge_descriptor e_global) const
    { return is_root() ? e_global : (*m_local_edge.find(get(get(edge_index, root().m_graph), e_global))).second; }

It looks like subgraphs can have alternate sets of edges. I disagree with this design choice and it is opaque, but it is already set.

That moves focus to whether a subgraph's included edges at creation should be left as default, copied from the next level up, or it is obviously incorrect. I'll hit this later. I've been up since 3AM local time, past 4:30 now and I'm dead tired.

from graph.

kenkangxgwe avatar kenkangxgwe commented on July 21, 2024

There you go the log:
https://gist.github.com/kenkangxgwe/af4ccb3cec3ae446dc5d69df2184caba

BTW, it seems that we are in the same Time Zone. Good night, bro.

from graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.