Skip to content

Conversation

@kaosiibeabuchi
Copy link

Incorporation of some C++ graph algorithms

Description

  • Prim's algorithm C++ implementation
  • Knight's Tour C++ implementation
  • Dijkstra's C++ implementation

How Has This Been Tested?

They have successfully passed all the unit tests created on my local machine

Copy link
Owner

@pearcej pearcej left a comment

Choose a reason for hiding this comment

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

Thanks for these, which are definitely needed! I also appreciate that it appears you worked to maintain the code style from the earlier chapters.

@pearcej
Copy link
Owner

pearcej commented Nov 20, 2025

@wrigjl Would you be able to review?

@pearcej pearcej assigned Copilot and unassigned Copilot Nov 20, 2025
@wrigjl
Copy link
Contributor

wrigjl commented Nov 20, 2025

Yes, I'll review these this weekend. Btw @pearcej , @kaosiibeabuchi is a student at Idaho State and is working with me on several projects (including this)

@pearcej
Copy link
Owner

pearcej commented Nov 20, 2025

@wrigjl Awesome! Thanks so much.

Our homecoming is this weekend and we have two big events in addition to department-chair craziness, so I only gave these a cursory view. Since we are "using namespace std", we can drop the std::'s, but I didn't want to inhibit such a positive contrubution, so I would have just removed them myself. Maybe @kaosiibeabuchi could remove them?

kaosiibeabuchi and others added 3 commits December 3, 2025 10:00
…algorithm-implementation

To https://github.com/kaosiibeabuchi/cppds.git
 ! [rejected]        cpp-algorithm-implementation -> cpp-algorithm-implementation (non-fast-forward)
error: failed to push some refs to 'https://github.com/kaosiibeabuchi/cppds.git'
hint: Updates were rejected because the tip of your
current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
PS C:\Users\Administrator\cppds> S C:\Users\Administrator\cppds> git push --set-upstream origin cpp-algorithm-implementation
To https://github.com/kaosiibeabuchi/cppds.git
 ! [rejected]        cpp-algorithm-implementation -> cpp-algorithm-implementation (non-fast-forward)
error: failed to push some refs to 'https://github.com/kaosiibeabuchi/cppds.git'
hint: Updates were rejected because the tip of your
current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
PS C:\Users\Administrator\cppds> Merge branch 'cpp-algorithm-implementation' of https://github.com/kaosiibeabuchi/cppds into cpp-algorithm-implementation
@wrigjl
Copy link
Contributor

wrigjl commented Dec 3, 2025

Ok, some feedback, my apologies for taking so long. Life...

The new code blocks are added as listings instead of preserving the tabbed interface. For an example of how to do that, look through book code for "exploration" tags.

The other question is for @pearcej , this code assumes that it can get at some of the data structures from earlier in the book via #include statements. If I understand correctly, you'd prefer to have all of the code present in the box, right Jan?

This reduces the clarity, but we can deal with that by having a small code box with the heart of the algorithm (i.e. just the function dijkstra for explanation and then the full working example at the bottom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants