Skip to content

Conversation

@ArpitaHanjagi
Copy link
Contributor

Algorithm: Yen's K Shortest Paths

Purpose: Finds the K shortest loopless paths between a source and target in a weighted directed graph.

Theory:

Starts with the shortest path using Dijkstra.

Iteratively generates alternative paths by deviating from previous paths.

Avoids cycles in paths.

Time Complexity: O(K * V * (V + E) * log V) with Dijkstra for each deviation.

Space Complexity: O(K * V).

Input: Weighted directed graph (adjacency list), source, target, K.

Output: List of K paths and their total distances.

Copilot AI review requested due to automatic review settings October 20, 2025 19:18
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 pull request introduces Yen's K Shortest Paths algorithm implementation in R, along with numerous supporting graph algorithms and dynamic programming solutions. The PR adds substantial educational content demonstrating various computer science algorithms with working examples.

Key Changes:

  • Implementation of Yen's K Shortest Paths algorithm (simplified version)
  • Addition of multiple graph algorithms (Kruskal, Prim, Dijkstra, Floyd-Warshall, etc.)
  • Implementation of dynamic programming solutions (knapsack, LCS, subset sum, etc.)
  • Documentation and example files for machine learning algorithms

Reviewed Changes

Copilot reviewed 141 out of 221 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
graph_algorithms/yen_k_shortest_paths.r Simplified Yen's algorithm using igraph library with placeholder implementation
graph_algorithms/*.r (multiple files) Comprehensive graph algorithm implementations with examples
dynamic_programming/*.r (multiple files) Various DP algorithms with detailed examples and testing
kruskal_mst.r Duplicate implementation of Kruskal's algorithm in wrong directory
documentation/*.md/*.html Machine learning tutorial references and example code outputs

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

You have changed 221 files, check your changes

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