Skip to content

New graphs project help#1

Open
scriabin-enjoyer wants to merge 2 commits intodamon314159:new-project-graphsfrom
scriabin-enjoyer:new-graphs-project-help
Open

New graphs project help#1
scriabin-enjoyer wants to merge 2 commits intodamon314159:new-project-graphsfrom
scriabin-enjoyer:new-graphs-project-help

Conversation

@scriabin-enjoyer
Copy link
Copy Markdown

@scriabin-enjoyer scriabin-enjoyer commented Dec 28, 2025

Because

Hi @damon314159 , I felt a bit bad about creating more work for you to do regarding this project, and I thought maybe I could offer some help regarding the conversion from using an adjacency matrix to an adjacency list, as well as putting together the ruby version of the project.

This PR

  • adds a new file, ruby/computer_science/project_graph.md, that presents the graph project for the ruby version of the course, with updated syntax/descriptions that are appropriate for the Ruby language. The file is added by the first commit, which preserves the original format of the project including using an adjacency matrix representation for the graph
  • Adds a commit on top of the previous one which created the ruby project version. This second commit proposes changes to the project that instructs learners to use an adjacency list instead of an adjacency matrix (but only for the ruby version)

Issue

Related to TheOdinProject#29037

Additional Information

Please see the commit mesage body of the second (most recent) commit in this PR to view the changes and reasoning I used for those changes regarding moving from matrix representation to list representation.

NOTE: This PR contains only suggestions and rough work that you may use in the completion of this new project. Technically, as of the time of this writing, it has not been definitively decided which graph representation to use — you and josh may come to that decision at your discretion. However, this is a tentative possibility. My only intention with this PR is to help with the completion of this project, and you may decide to include or reject any amount of the work contained in these commits, but I do hope you find it useful.

NOTE: To see the diff between the javascript version of the project and the ruby version of the project, you can use (from TOP curriculum root):

git diff --no-index ./javascript/computer_science/project_graph.md ./ruby/computer_science/project_graph.md

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

This commit:

- Instructs learners to use an adjacency list instead of adjacency
matrix, as adjacency lists offer several benefits over matrices
regarding ease of comprehension, implementation complexity, state
management, and typical-use cases.

- Adds a corresponding explanation on the usage of adjacency lists and
links an additional G4G article that discusses the time and space
complexity trade-offs in the graph operations when using a list vs. a
matrix.

- Changes the `print graph` operation **Tip** to a required function
that learners must implement on their Graph. The G4G article describes
the adjacency list representation as using an array to store the
vertices, and linked lists to store the edges for each element in the
vertices array. Learners may elect to re-use the LinkedList they made in
the previous LinkedList project, or they may elect to use other
(builtin) structures offered by their language. Hard-coding a particular
`print` function forces them into a particular implementation, which
would require us to explicitly instruct the learners to use this
implementation, but this is a choice they should be making so that they
can practice making such design decisions themselves.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant