Skip to content

Conversation

@Prathameshk2024
Copy link
Contributor

• Assigns colors to graph vertices ensuring no adjacent vertices share the same color
• Uses backtracking approach for optimal solution
• Finds chromatic number (minimum colors needed)
• Implements greedy coloring for faster approximation
• Includes Welsh-Powell algorithm (degree-based ordering)
• Validates coloring solutions for correctness
• Demonstrates with multiple test cases (triangle, Petersen, bipartite, random graphs)
• Time complexity: O(m^V), Space complexity: O(V)
• Production-ready implementation with comprehensive examples

Copilot AI review requested due to automatic review settings October 19, 2025 08:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds classic graph coloring algorithms (backtracking, greedy, Welsh–Powell) with validation and demonstrations, and also introduces Bidirectional BFS and the Viterbi algorithm with example usage.

  • Adds graph coloring algorithms with chromatic number search and validation helpers
  • Introduces Bidirectional BFS (shortest path) and Viterbi (HMM decoding) implementations
  • Includes comprehensive, runnable examples; one extraneous file appears to be accidentally committed

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
graph_algorithms/graph_coloring.r New graph coloring implementations (backtracking, greedy, Welsh–Powell), chromatic number calculation, validation, and example demos.
graph_algorithms/bidirectional_bfs.r New Bidirectional BFS shortest-path implementation with example; contains a stray return at EOF that breaks script execution.
dynamic_programming/viterbi.r New Viterbi algorithm with example usage for HMM decoding.
et --soft HEAD~1 Appears to be an accidentally committed git log; should be removed.
Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This file appears to be an accidentally committed git log and does not belong in the repository. Please remove it from the PR.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

Copilot AI review requested due to automatic review settings October 19, 2025 09:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This appears to be an accidental commit of a git log dump and does not belong in the repository. Please remove the file from the PR.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

Copilot AI review requested due to automatic review settings October 19, 2025 09:08
@Prathameshk2024
Copy link
Contributor Author

@siriak

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This appears to be an accidental commit of git log output and not source code. Please remove this file from the repository and the PR.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

Copilot AI review requested due to automatic review settings October 19, 2025 09:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This appears to be an accidental commit of a git log/metadata file, not source code. Please remove this file from the repository.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

@siriak
Copy link
Member

siriak commented Oct 24, 2025

Please resolve conflicts

Copilot AI review requested due to automatic review settings October 24, 2025 15:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This file "et --soft HEAD~1" appears to be Git command output that was accidentally committed. It should be removed from the repository as it's not part of the algorithm implementation and doesn't belong in version control.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

Copilot AI review requested due to automatic review settings October 24, 2025 16:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This file appears to be a Git command output that was accidentally committed. Files with Git command names like "et --soft HEAD~1" should not be part of the repository. This file should be removed from the commit.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

Copilot AI review requested due to automatic review settings October 25, 2025 12:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This file appears to be a Git command output that was accidentally committed. Files containing Git history or command outputs should not be added to the repository. This file should be removed from the PR.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

Copilot AI review requested due to automatic review settings October 25, 2025 12:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This file appears to be a git log output that was accidentally committed. It should be removed from the repository and added to .gitignore if needed.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

Copilot AI review requested due to automatic review settings October 25, 2025 13:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This file 'et --soft HEAD~1' appears to be Git command output that was accidentally committed. It should be removed from the repository as it's not a valid source file and contains Git history data that shouldn't be tracked.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

Copilot AI review requested due to automatic review settings October 25, 2025 13:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

et --soft HEAD~1:1

  • This file appears to be a Git log output that was accidentally added to the repository. It should be removed from version control as it's not part of the codebase and was likely created by a mistyped Git command.
�[33mcommit 7d4b7af52036b21abf54435f14250ef170351389�[m�[33m (�[m�[1;36mHEAD�[m�[33m -> �[m�[1;32mGraph_colouring�[m�[33m)�[m

}
}

for (c in 1:(n + 1)) {
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

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

The loop iterates up to n + 1, but the available vector is only allocated with size n + 1 at line 119. This creates unnecessary overhead and potential for confusion. The available vector and loop should both use size n since there can be at most n colors needed for any graph (one per vertex). Change line 119 to available <- rep(TRUE, n) and line 127 to for (c in 1:n).

Copilot uses AI. Check for mistakes.
@siriak
Copy link
Member

siriak commented Oct 25, 2025

Resolve conflicts

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.

2 participants