HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
OmkarPathak
pygorithm
Python2017–2018
OmkarPathak / pygorithm

pygorithm

A Python module for learning all major algorithms

3Distinct people
3Mentions
0Explicit recommenders
4.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A Python module for learning all major algorithms

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 6:01:08 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month3 dated mentions

Observed mentions: 2017-08-07 23:49:34 UTC to 2018-05-24 08:05:53 UTC.

0122017-08-01 00:00:00 UTC to 2017-09-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 commentsAug 20172017-09-01 00:00:00 UTC to 2017-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-10-01 00:00:00 UTC to 2017-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-11-01 00:00:00 UTC to 2017-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-12-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsDec 20172018-01-01 00:00:00 UTC to 2018-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-02-01 00:00:00 UTC to 2018-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-03-01 00:00:00 UTC to 2018-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-04-01 00:00:00 UTC to 2018-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-05-01 00:00:00 UTC to 2018-06-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMay 2018

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Aug 20172017-08-01 00:00:00 UTC2017-09-01 00:00:00 UTC211
Sep 20172017-09-01 00:00:00 UTC2017-10-01 00:00:00 UTC000
Oct 20172017-10-01 00:00:00 UTC2017-11-01 00:00:00 UTC000
Nov 20172017-11-01 00:00:00 UTC2017-12-01 00:00:00 UTC000
Dec 20172017-12-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
Jan 20182018-01-01 00:00:00 UTC2018-02-01 00:00:00 UTC000
Feb 20182018-02-01 00:00:00 UTC2018-03-01 00:00:00 UTC000
Mar 20182018-03-01 00:00:00 UTC2018-04-01 00:00:00 UTC000
Apr 20182018-04-01 00:00:00 UTC2018-05-01 00:00:00 UTC000
May 20182018-05-01 00:00:00 UTC2018-06-01 00:00:00 UTC101

What Hacker News says

2 sources
Check the bfs code at https://github.com/OmkarPathak/pygorithm/blob/b7a5c1cda3b945...: # breadth first search algorithm def search(graph, startVertex): # Take a list for stoting already visited vertexes if startVertex not in graph or graph[startVertex] is None or graph[startVertex] == []: return None # create a list to store all the vertexes for BFS and a set to store the visited vertices visited, queue = set(), [startVertex] while queue: vertex = queue.pop(0) if vertex not in visited: visited.add(vertex) queue.extend(graph[vertex] - visited) return visited It returns None if there is a bad input or if the start node is a leaf. That's very weird, as None would seem to indicate an error but searching from a leaf
Read the rest
is not normally an error. You should return a set just containing the start vertex if you start on a leaf. This doesn't need to be a special case. The initial guard also checks whether graph[startNode] is None, but this is never checked when looking up other nodes in the graph. Whether you check this should be consistent. The loop pops the zeroth element from the queue. As the queue is a list, this is a linear time operation. This makes the bfs implementation have quadratic worst-case complexity rather than the linear complexity it should have. The Python standard library has a deque class that can be used to fix this, and it would be more instructive and more correct to use that. This also means the time complexity function is wrong. So 2 clear bugs and 1 weird and probably unnecessary check in the bfs implementation. Also, the implementation has no comments to explain how it works, why it has the time complexity it does, or how you might tweak it to accomplish different goals. I don't see how someone who didn't already know BFS could learn from this. There's nothing here that teaches the algorithm, and the implementation is weirdly flawed. On top of all this, the package claims to teach all major algorithms but only contains a handful of sorting and searching algorithms. It doesn't even have a UI to help people discover and learn about the algorithms it does teach. You just have to know which ones are there and import them, then run a bunch of commands to print out the source code. This UI is worse than just browsing the source on GitHub, and that's much worse than just looking the algorithms up on Wikipedia or reading a textbook. I really don't get why someone would share this on HN in its current state. It looks like what you'd throw together for sample data before you started working on your algorithm teaching package.
In Pygorithm – A Python module for learning major algorithms

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.