Graphs #202
Labels
A-pattern
Area: Content about Patterns
C-addition
Category: Adding new content, something that didn't exist in the repository before
C-needs discussion
Area: Something that is not clear to everyone if it fixes something/adds valuable content
E-help wanted
Call for participation: Help is requested to fix this issue
I think Graph data structure, on its own, is too wide topic to cover in a couple of pages. As a rule, complexity of algorithms on graphs directly depends their representation. What kind of representation we will choose depends on our use case. Factors to take into account:
Let me give a simple example. Say, I know my graph changes (new edges or vertex) once a day, but the graph is almost complete and in my algorithms I traverse neighbours of a single vertex not too often. I'd probably use adjacency matrix.
Or another example. If we know that our graph has too few edges and we do extensive DFS then matrix is a bad choice since it would have O(n^2) complexity, while using adj list we could reduce it to linear time O(n) if say m is linear in n.
Originally posted by @fade2black in #68 (comment)
The text was updated successfully, but these errors were encountered: