Relative Content

Tag Archive for graph

Breadth-first graph search problem

I thought I was doing breadth-first graph search correctly, but my instructor’s grading script is telling me that my answer is incorrect.

Breadth-first graph search problem

I thought I was doing breadth-first graph search correctly, but my instructor’s grading script is telling me that my answer is incorrect.

Breadth-first graph search problem

I thought I was doing breadth-first graph search correctly, but my instructor’s grading script is telling me that my answer is incorrect.

Memory limit exceeded clarification

There’s a memory limit exceeded error when calling a dfs function twice in a loop. Running the function separately for 0 and 1 works fine, but calling it twice in the same iteration causes issues. This is puzzling because each iteration should be independent, with the memory used by variables and the dfs stack space being released after the iteration ends. Notably, if the adjacency list is passed by reference, the code works correctly. It seems that the memory isn’t being fully cleared after each iteration, but if the iterations are truly independent, there shouldn’t be a cumulative memory effect.

using internal or external iterators over graph edges

I’ve written some code to manipulate sparse graphs for school work I’m doing, and I have an operation which requires me to loop over all the edges of a graph. The interface I need to implement is some function

What graph traversal algorithm should I use?

I would like to write an algorithm which can traverse a graph and hopefully later I can implement it to use for an indoor navigation system.
The graph would come from floor plans of a building and the graph nodes represent the building objects such as doors, corridors, stairs, rooms, etc.

What graph traversal algorithm should I use?

I would like to write an algorithm which can traverse a graph and hopefully later I can implement it to use for an indoor navigation system.
The graph would come from floor plans of a building and the graph nodes represent the building objects such as doors, corridors, stairs, rooms, etc.