Comments (6)
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.
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.
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.
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.
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.
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)
- A mistake in r_c_shortest_paths_example.cpp HOT 1
- `depth_first_visit_impl`: `finish_edge` not invoked when it should on MSVC HOT 2
- Algorithm for generating a random Flow Network/Graph HOT 1
- [Feature request] Implementation of Held-Karp lower bound for the TSP HOT 1
- Improve docs for ResourceExtensionFunction in r_c_shortest_paths
- Boost.Graph no longer builds with C++03 HOT 6
- astar_search does unnecessary initialization of vertices
- broken link to example for reverse graph adaptor HOT 6
- adjacency_matrix::add_vertex always aborts in Debug mode ? HOT 2
- Single-path RCSP does not return always the shortest path HOT 7
- Stack-overflow in boost::read_graphviz_detail::parser::parse_subgraph HOT 23
- Option to allow `breadth_first_search` to use `in_edges`
- Question on negative flow on arcs in Boykin-Kolmogorov algorithm -- meaning and interpretation
- Modular Boost C++ Libraries Request HOT 1
- read_graphml function rejecting well formed Graphml files HOT 1
- If using Boost::subgraph. Don't use Vertex_index_t.
- New near-linear time algorithm to solve the minimum cut problem for undirected graphs HOT 8
- CSR: Indexed properties maps are unstable
- creation of nested subgraphs by vertex descriptors is broken/unintuitive HOT 5
- kruskal_minimum_spanning_tree not working on filtered graph with weight map as named property
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graph.