Skip to content

Conversation

@ArpitaHanjagi
Copy link
Contributor

Algorithm: Random Walk with Restart (RWR)

Purpose: Computes relevance scores of nodes in a graph based on a random walker that restarts at a source node with a fixed probability.

Theory:

Represents graph as adjacency matrix.

At each step, walker either moves to a neighbor or restarts at source.

Iterates until probability vector converges.

Time Complexity: O(max_iter * V²) for adjacency matrix multiplication.

Space Complexity: O(V²) for adjacency matrix.

Input: Adjacency matrix, restart probability, source node, max iterations, tolerance.

Output: Vector of steady-state probabilities representing node relevance.

Copilot AI review requested due to automatic review settings October 20, 2025 19:21
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 implements the Random Walk with Restart (RWR) algorithm, a graph-based ranking method that computes node relevance scores by simulating a random walker that probabilistically restarts at a source node.

Key Changes:

  • Adds RWR algorithm implementation in random_walk_restart.r
  • Includes multiple graph algorithm implementations (Kruskal's MST, Dijkstra, BFS/DFS, Floyd-Warshall, etc.)
  • Adds dynamic programming solutions (Knapsack, LCS, LIS, etc.)
  • Includes documentation files for machine learning algorithms

Reviewed Changes

Copilot reviewed 142 out of 222 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
graph_algorithms/random_walk_restart.r Implements RWR algorithm with example usage
graph_algorithms/kruskal_mst.r Kruskal's MST with Union-Find structure
graph_algorithms/dijkstra_shortest_path.r Dijkstra's algorithm with priority queue
graph_algorithms/floyd_warshall.r All-pairs shortest path using R6 class
graph_algorithms/breadth_first_search.r BFS implementation with path finding
graph_algorithms/depth_first_search.r Recursive and iterative DFS
dynamic_programming/longest_increasing_subsequence.r O(n²) and O(n log n) LIS solutions
dynamic_programming/0/1_knapsack_problem.r Classic 0/1 Knapsack DP solution
documentation/*.md Machine learning documentation files
machine_learning/README.md Tutorial links for ML in R

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 222 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