The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
1answer
125 views

Is this implementation of Kruskal's algorithm maintainable and efficient?

Update I've posted some updated code and included the definition of Vertex and Edge to try to answer as many questions as I could. To summarize what's changed: I've followed the advice here to ...
1
vote
0answers
25 views

Is this code for getting the dependency tree of a file correct?

function dep_tree(graph,node,prev_deps){ return uniq(flatten(graph[node].map(function(child_node){ if (contains(prev_deps,child_node)) throw "Circular reference between ...
0
votes
2answers
52 views

Improving readability of non-recursive depth first search function in Lisp

As a free-time activity in order to learn some Lisp I had to implement depth first directed graph search. Due to large graph size (800K nodes, 5M arcs) recursion-based approach I could devise didn't ...
3
votes
1answer
149 views

My first python graph traversal review

I'm trying to solve a graph traversal problem I found, and was wondering how I could improve my implementation. Currently it seems a little convoluted and long. The problem is as follows: I have a ...
1
vote
0answers
38 views

BFS implementation to find connected components taking too long

This is in continuation to a question i asked here. Given the total number of nodes(employees) and the adjacency list(friendship amongst employees) I need to find all the connected components. Below ...
2
votes
1answer
97 views

Evaluating longest path

Here is a program which keeps track of the longest path in a graph. I think it can be written much better. from Tkinter import * ''' This program tries to compute the longest path (largest number of ...