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

added social_network example #167

Closed
wants to merge 1 commit into from
Closed

Conversation

Poornima2003
Copy link

Issue #10
I have added the example for social_network section

Copy link
Contributor

@github-actions github-actions bot left a 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 :)

Copy link
Collaborator

@joweich joweich left a 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>
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 @@

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <graaflib/graph.h>

Graaf::Graph socialNetwork;

// Add nodes for users in the social network
Graaf::Node userAlice = socialNetwork.addNode("Alice");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
socialNetwork.addEdge(userAlice, userBob);
graph.add_edge(user_alice, user_bob, 100);

Added 100 as an example edge weight

Copy link
Contributor

Stale pull request message

Copy link

codecov bot commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (58423fc) 99.59% compared to head (5ba3415) 99.59%.
Report is 10 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Stale pull request message

Copy link
Contributor

Stale pull request message

Copy link
Contributor

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.
Please allow some time for @bobluppes to take a closer look.

@github-actions github-actions bot added the stale label Jan 27, 2024
@bobluppes
Copy link
Owner

Hi @Poornima2003, closing this for now. Feel free to re-open if you want to continue working on it

@bobluppes bobluppes closed this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants