Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement data structures for graph algorithms #335

Closed
alxmjo opened this issue May 26, 2020 · 24 comments
Closed

Implement data structures for graph algorithms #335

alxmjo opened this issue May 26, 2020 · 24 comments

Comments

@alxmjo
Copy link
Collaborator

alxmjo commented May 26, 2020

In order to add graph algorithms, we must first add graph data structures. We'll need data structures for both directed and undirected graphs. We'll want to be able to add vertices and edges. In the end it'll be valuable to have implementations for both an adjacency list and an adjacency matrix.

If you're interested in adding this please explain your plan below so that we can get started. 🙂

See #70 for previous conversation on the subject.

@a-moreira
Copy link
Contributor

I'm interested in doing this. I can implement adj. list and matrix for undirected graphs first. Do you think it's necessary to use classes?

@alxmjo
Copy link
Collaborator Author

alxmjo commented May 28, 2020

Yes. Have a look at binary search tree and the linked list data structures.

@beardbytes
Copy link

Hello , I am interested in taking up the issue . I am currently new to open source and have been working on DSA for building my base foundation .

@a-moreira
Copy link
Contributor

a-moreira commented May 28, 2020

@alxmjo OK, I'll implement them that way.

@alxmjo
Copy link
Collaborator Author

alxmjo commented May 28, 2020

Thanks for the interest, @a-moreira and @Maverick12345678. Assigning to @a-moreira since he mentioned it first. If still open after two weeks has passed I'll put it back up for grabs to give others a shot. 🙂

@a-moreira
Copy link
Contributor

a-moreira commented Jun 9, 2020

@alxmjo Just to remind you I'm working on this :-) No need to put it back up for grabs yet!

@a-moreira
Copy link
Contributor

a-moreira commented Jun 16, 2020

@alxmjo I implemented the adjacency matrix data structure for graphs plus some methods. I haven't written the tests yet, but I'd like some thoughts and comments before proceeding to do that and to implement the adjacency lists. Should I open a pull request to show the code?

@alxmjo
Copy link
Collaborator Author

alxmjo commented Jun 16, 2020

Of course. Just open it as a draft PR.

@a-moreira
Copy link
Contributor

a-moreira commented Jun 16, 2020

@alxmjo I opened the draft PR. I forgot the comments about the time and space complexities, I'll add them in the next commit. They're fairly easy to guess, though.

@alxmjo
Copy link
Collaborator Author

alxmjo commented Jun 17, 2020

Thanks for the update. I won't be able to have a close look till this weekend or early next week. Thanks for being patient.

@alxmjo alxmjo linked a pull request Jun 17, 2020 that will close this issue
3 tasks
@Avish34
Copy link

Avish34 commented Aug 23, 2020

Is this Issue Still Open? Actually I Would Like add more features to Graph Data Structure such as BFS, DFS, Cycle Detection etc.
Please revert back if you find it appropriate. Also if you have more issue or you want to enhance any feature of a Data Structure, I would be really interested and excited in doing it.

@akshatjain04
Copy link

I Would be glad to work on the algorithms of Graph for this issue,in case it is open, so kindly reply to this comment if the the issue is still open .

@Manoj0803
Copy link

I'm interested in this and I would like to work on articulation point and bridges. If it's still open.

@bhavitjain
Copy link

I Would be glad to work on the algorithms of Graph for this issue, in case it is open, Also if you have more issue or you want to enhance any feature of a Data Structure, I would be really interested and excited in doing it.

@dcyrus
Copy link

dcyrus commented Aug 23, 2020

I would love to contribute, Can I work on it?

@a-moreira
Copy link
Contributor

@Avish34 @akshatjain04 @Manoj0803 @bhavitjain @dcyrus @alxmjo I am working on this. I've been a little slow because of the pandemics, but I'm going to update it soon. As soon as I finish the Matrix and Adj. List implementations you can implement some algorithms if you want.

@alxmjo
Copy link
Collaborator Author

alxmjo commented Sep 13, 2020

@a-moreira Since there are several other interested contributors, could we have an update on your progress?

@a-moreira
Copy link
Contributor

@alxmjo Sure. I will deliver the data structures and tests by the end of this week so everyone can start implementing the algorithms.

@SimonLammer
Copy link

@a-moreira Any progress / Is there anything I can help you with (although I'm hardly familiar with this repo)?
I've just learned several graph algorithms for building convex hulls and think it might be a good idea to implement them in this repo.

@a-moreira
Copy link
Contributor

a-moreira commented Sep 29, 2020

@SimonLammer @Avish34 @akshatjain04 @Manoj0803 @bhavitjain @dcyrus Yes, sure. Anyone who wants to do the adjacency list implementation of a graph, and any algorithms using it, is welcome. I really won't be able to do that in the near future. Just read the docs and follow the guidelines. If you have questions, just ask @alxmjo or me.

@hitch-hiker42
Copy link

hitch-hiker42 commented Oct 20, 2020

I want to contribute to the cause, I'm writing a generic struct so that it works for both directed and undirected graph variants, and there are two versions: one uses the list representation, the other uses the matrix representation. The struct has the methods as you've mentioned: the constructor initializes the adjacency data structure (list or matrix) and sets the number of vertices and edges (if provided any, 0 by default), there's a method to add vertices (though, I doubt if it is really helpful) and one to add edge. Finally, there's a default parameter that determines if the graph is weighted and if so, the add-edge method works likewise. Please assign me if the issue is still open, I'll be glad to help.

@alxmjo
Copy link
Collaborator Author

alxmjo commented Oct 20, 2020

@hitch-hiker42 Others may be working on this issue, but don't let that keep you from working on them, too, especially if you'd like the practice.

@hitch-hiker42
Copy link

It is alright, I actually implemented it in the afternoon and I liked the practice indeed. Good day 😄

@stale
Copy link

stale bot commented Dec 19, 2020

This issue has been automatically marked as inactive because it has not had recent activity. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Inactive label Dec 19, 2020
@stale stale bot closed this as completed Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants