-
-
Notifications
You must be signed in to change notification settings - Fork 49
Add cycle graph test for pgr_cuthillMckeeOrdering #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThis update extends the Changes
Sequence Diagram(s)sequenceDiagram
participant TR as Test Runner
participant EC as edge_cases()
participant CGT as cycle_graph_table
participant Q12 as Prepared Statement q12
participant CMK as pgr_cuthillMckeeOrdering()
participant Validator as set_eq
TR->>EC: Invoke edge_cases test
EC->>CGT: Create table and insert cycle graph data
EC->>Q12: Execute query for cycle graph data
Q12-->>EC: Return cycle graph data
EC->>Validator: Validate cycle graph structure
EC->>CMK: Run ordering via prepared statement r13
CMK-->>EC: Return vertex ordering
EC->>Validator: Validate vertex ordering
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
@coderabbitai summary |
✅ Actions performedSummary regeneration triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pgtap/ordering/cuthillMckeeOrdering/edge_cases.pg (1)
203-209
: Add explanation for the expected ordering.The expected ordering (1, 4, 2, 3) is verified, but it would be helpful to add a brief comment explaining why this specific ordering is expected for a cycle graph when using the Cuthill-McKee algorithm.
RETURN QUERY SELECT set_eq('r13', $$VALUES (1, 1), -- Vertex 1 is placed first (2, 4), -- Vertex 4 is placed second (3, 2), -- Vertex 2 is placed third (4, 3)$$, -- Vertex 3 is placed fourth + -- In Cuthill-McKee ordering, after starting with vertex 1, + -- it processes its neighbors in ascending order (4 comes before 2) 'r13: Cycle graph ordering');
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pgtap/ordering/cuthillMckeeOrdering/edge_cases.pg
(2 hunks)
🔇 Additional comments (7)
pgtap/ordering/cuthillMckeeOrdering/edge_cases.pg (7)
22-22
: Plan count updated correctly to match new tests.The plan count has been increased from 11 to 13 to accommodate the new cycle graph test (2 additional test cases).
170-170
: Good addition of the cycle graph test case.Adding a cycle graph test is valuable as it tests a specific graph topology not covered by the existing test cases.
172-178
: Table definition follows consistent pattern.The
cycle_graph_table
definition matches the schema of other test tables in this file, which is good for consistency.
180-184
: Clear data insertion with helpful comments.The edge insertions clearly define a cycle graph (1->2->3->4->1) and the inline comments make the structure easy to understand.
186-189
: Query preparation follows established pattern.The
q12
prepared statement follows the same pattern as other queries in the file, maintaining consistency.
191-198
: Test validation is comprehensive.The
set_eq
validation ensures that the cycle graph data matches exactly what was inserted, maintaining the integrity of the test.
199-202
: Ordering function test follows established pattern.The
r13
prepared statement correctly tests thepgr_cuthillMckeeOrdering
function on the cycle graph.
Looks nice, just some changes are needed. we can discuss in the next show and tell. |
Thank you! I’m looking forward to the discussion with you! |
Changes proposed in this pull request:
pgtap/ordering/cuthillMckeeOrdering/edge_cases.pg
.Test Output
Below is the pgTAP test output for the changes:
@pgRouting/admins
Summary by CodeRabbit