Skip to content
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

introduce tarjan's algorithm (#103) #322

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

suncanghuai
Copy link
Contributor

  • implement tarjan's algorithm to find scc for directed graphs
  • implement tarjan's algorithm to find cut vertices/bridges/V-Dcc/E-Dcc for undirected graphs
  • formatting

There might be different purposes of Tarjan's algorithm, but the basic framework and core idea of it are the same. So I implemented a common function for Tarjan's algorithm which return different results based on the input parameter instead of multiple slightly modified versions of that.

@github-actions github-actions bot added the core something about core label Jul 2, 2023
@ghost
Copy link

ghost commented Jul 2, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@suncanghuai
Copy link
Contributor Author

This work is not done yet as I've been too busy recently writing test cases and making sure my submission is bug-free. I opened this PR not wanting this submission to be merged now, but to share my progress with you guys @ZigRazor. Testing work and bug fixes are expected to be finished in the next few weeks.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cppcheck (reported by Codacy) found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@codecov
Copy link

codecov bot commented Jul 2, 2023

Codecov Report

Merging #322 (0c383d1) into master (98432ff) will increase coverage by 0.03%.
Report is 9 commits behind head on master.
The diff coverage is 97.61%.

@@            Coverage Diff             @@
##           master     #322      +/-   ##
==========================================
+ Coverage   97.23%   97.26%   +0.03%     
==========================================
  Files          54       55       +1     
  Lines        7907     8313     +406     
==========================================
+ Hits         7688     8086     +398     
- Misses        219      227       +8     
Flag Coverage Δ
unittests 97.26% <97.61%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
include/Utility/Typedef.hpp 100.00% <ø> (ø)
include/Graph/Graph.hpp 94.83% <94.11%> (-0.05%) ⬇️
test/TarjanTest.cpp 99.14% <99.14%> (ø)

... and 2 files with indirect coverage changes

* implement tarjan's algorithm to find sccs for directed graphs

* implement tarjan's algorithm to find cut vertices/bridges/vdcc/edcc
  for undirected graphs

* formatting
@ZigRazor ZigRazor added the development Development of new Functionalities label Jul 2, 2023
@ZigRazor ZigRazor self-assigned this Jul 2, 2023
@ZigRazor ZigRazor linked an issue Jul 2, 2023 that may be closed by this pull request
@ZigRazor ZigRazor marked this pull request as draft July 3, 2023 07:34
@ZigRazor
Copy link
Owner

ZigRazor commented Jul 3, 2023

Ok @suncanghuai I convert this to draft PR until it will be completed

@github-actions github-actions bot added the test Something about test label Jul 13, 2023
test/TarjanTest.cpp Fixed Show fixed Hide fixed
suncanghuai added 2 commits August 8, 2023 17:10
* add test cases for Tarjan's algorithm for finding sccs

* fix bugs of Tarjan's algorithm for finding sccs
* add test cases for Tarjan's algorithm for finding cut-vertices/bridges/vbccs/ebccs

* fix a bug of Tarjan's algorithm for finding vbccs

* remove printf statements from TarjanTest.cpp
@suncanghuai suncanghuai marked this pull request as ready for review August 8, 2023 09:20
@suncanghuai
Copy link
Contributor Author

suncanghuai commented Aug 8, 2023

@ZigRazor, Tarjan's algorithm was fully tested. I think it's time to merge it.
image

Copy link
Owner

@ZigRazor ZigRazor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@ZigRazor ZigRazor merged commit 84603a5 into ZigRazor:master Aug 9, 2023
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core something about core development Development of new Functionalities test Something about test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Tarjan's algorithm
2 participants