Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8615281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:20:15+00:00 2026-06-12T05:20:15+00:00

I have been searching for an answer to this question but could not find

  • 0

I have been searching for an answer to this question but could not find any mention, so I decided to post here. I am trying to see if igraph or any packages provide a simple way to create a “community graph” where each node represents a community in the network and the ties represent ties between the communities. I can get the community detection algorithm to work fine in igraph, but I could not find a way to collapse the results to just show connections between each community. Any assistance would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:20:17+00:00Added an answer on June 12, 2026 at 5:20 am

    You can simply use the contract.vertices() function. This contracts groups of vertices into a single vertex, essentially the same way you want it. E.g.

    library(igraph)
    
    ## create example graph
    g1 <- graph.full(5)
    V(g1)$name <- 1:5    
    g2 <- graph.full(5)
    V(g2)$name <- 6:10
    g3 <- graph.ring(5)
    V(g3)$name <- 11:15
    g <- g1 %du% g2 %du% g3 + edge('1', '6') + edge('1', '11')
    
    ## Community structure
    fc <- fastgreedy.community(g)
    
    ## Create community graph, edge weights are the number of edges
    cg <- contract.vertices(g, membership(fc))
    E(cg)$weight <- 1
    cg2 <- simplify(cg, remove.loops=FALSE)
    
    ## Plot the community graph
    plot(cg2, edge.label=E(cg2)$weight, margin=.5, layout=layout.circle)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been searching everywhere but I could not find an answer. I need
I have been searching desperately for an answer to this question, but not found
I have been searching for an answer to this question but cannot find anything
I have been searching and searching for an answer to this question but with
This question might seem strange but I have been searching for an answer for
I have been searching the internet wildly for an answer to this question. We
I have been searching around using Google but I can't find an answer to
I have been searching the answer to this question for a while. It seemed
I have been searching here for some time but haven't been able to find
I've been searching for an answer to this but I can't seem to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.