-
Notifications
You must be signed in to change notification settings - Fork 41
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
added social_network example #167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there! Thank you for creating your first pull-request on the Graaf library :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Poornima2003, great to see your contribution!
However, the references/functions/types you're using aren't part of our codebase under these names. You can check the other examples in this repo.
I assume you used an LLM for inspiration (which is totally fine). I'd suggest to feed it with parts of our codebase to increase the models fit.
In any case, the code needs to compile and run successfully on your local machine and in our CI. Let me know if you need help! 🙂
@@ -0,0 +1,35 @@ | |||
|
|||
#include <iostream> | |||
#include <graaflib/algorithm/social_network.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file does not exist
|
||
int main() { | ||
// Create a graph to represent the social network | ||
Graaf::Graph socialNetwork; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Graaf::Graph socialNetwork; | |
graaf::undirected_graph<V, E> graph{}; |
You need to specify the graph type here. I think undirected
is reasonable for social networks. The V
and E
should be replaced with more reasonable types according to the specific use case
@@ -0,0 +1,35 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <graaflib/graph.h> |
Graaf::Graph socialNetwork; | ||
|
||
// Add nodes for users in the social network | ||
Graaf::Node userAlice = socialNetwork.addNode("Alice"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Graaf::Node userAlice = socialNetwork.addNode("Alice"); | |
const auto user_alice{graph.add_vertex("Alice")}; |
Graaf::Node userCharlie = socialNetwork.addNode("Charlie"); | ||
|
||
// Add edges to represent connections (friendships) between users | ||
socialNetwork.addEdge(userAlice, userBob); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
socialNetwork.addEdge(userAlice, userBob); | |
graph.add_edge(user_alice, user_bob, 100); |
Added 100 as an example edge weight
Stale pull request message |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #167 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 56 56
Lines 2714 2714
=======================================
Hits 2703 2703
Misses 11 11 ☔ View full report in Codecov by Sentry. |
Stale pull request message |
Stale pull request message |
Marking this PR as stale. It will not be automatically closed. Even though the maintainers of Graaf may not always have time to take a look in a timely fashion, your contributions are much appreciated. |
Hi @Poornima2003, closing this for now. Feel free to re-open if you want to continue working on it |
Issue #10
I have added the example for social_network section