Bug in biconnected_components when handling multiple (parallel) edges between the same pair of vertices
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Version of Boost
1.88.0
Problem description
In a block of parallel edges (e.g., three edges between A and B), only one edge receives the correct biconnected component label.
The rest are incorrectly assigned component ID 0 — even though they belong to the same biconnected component.
Expected behavior
All edges in a block of parallel edges should have the same non-zero component ID
Actual behavior
Only one edge gets the correct component ID; others are assigned 0 — which is wrong
Reproducible example
Problem can be reproduced with such program.
#include <boost/config.hpp>
#include <vector>
#include <list>
#include <boost/graph/biconnected_components.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/properties.hpp>
#include <boost/property_map/property_map.hpp>
#include <iterator>
#include <iostream>
namespace boost
{
struct edge_component_t
{
typedef edge_property_tag kind;
} edge_component;
}
int main()
{
using namespace boost;
typedef adjacency_list<vecS, vecS, undirectedS,
property<boost::vertex_index_t, std::size_t>,
property<edge_component_t, std::size_t>
> graph_t;
typedef graph_traits<graph_t>::vertex_descriptor vertex_t;
typedef graph_traits<graph_t>::vertices_size_type size_type;
std::vector<std::pair<size_t, size_t>> graph_edges = {
{0, 1}, {0, 1}, {0, 1}, // block of parallel edges
{1, 2}, // bridge
{2, 3}, {2, 3}, {2, 3}, // block of parallel edges
{3, 4}, // bridge
{4, 5} // bridge
};
graph_t g(graph_edges.size());
for (const auto& pair : graph_edges)
add_edge(pair.first, pair.second, g);
property_map<graph_t, edge_component_t>::type comp_map = get(edge_component, g);
std::vector<vertex_t> art_points;
auto num_comps = biconnected_components(g, comp_map, std::back_inserter(art_points));
std::cerr << "Found " << num_comps.first << " biconnected components.\n";
std::cerr << "Found " << art_points.size() << " articulation points.\n";
graph_traits<graph_t>::edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
std::cout << (char)(source(*ei, g) + 'A') << " -- "
<< (char)(target(*ei, g) + 'A')
<< " " << comp_map[*ei] << "\n";
return 0;
}
Actual output
The proram output contains block index for each edge of graph:
Found 5 biconnected components.
Found 4 articulation points.
A -- B 4
A -- B 0
A -- B 0
B -- C 3
C -- D 2
C -- D 0
C -- D 0
D -- E 1
E -- F 0
Only one of parallel edges A-B has non-zero block index. Same stands for edges C-D.
Picture shows the graph from example. Red vertices indicate articulation points. Each edge is labeled with index of biconnected component (block) to which it belongs Picture makes clear that output of example is incorrect - each group of parallel edges should form a distinct block.
Expected output
Found 5 biconnected components.
Found 4 articulation points.
A -- B 4
A -- B 4
A -- B 4
B -- C 3
C -- D 2
C -- D 2
C -- D 2
D -- E 1
E -- F 0
- Ngôn ngữ chính
- C++
- Star
- 397
- Fork
- 246
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 31
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của boostorg/graph
-
beginner friendly
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
boostorg/graph#593 · 39 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
algorithm beginner friendly priority: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
boostorg/graph#231 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
algorithm
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
boostorg/graph#599 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Implementing personalized PageRank for graph node scoring.Có thể đã có người làm @Becheler đã nhận 135 ngày trước. Đang mởalgorithm
boostorg/graph#493 · 22 bình luận · 1 reaction · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của boostorg/graph
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
EsotericSoftware/spine-runtimes#3186 ·
-
Round video messages start gray and blocky with libx264: encoder is configured for 1,000,000 fpsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
telegramdesktop/tdesktop#31422 ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
zen-browser/desktop#15809 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày