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 9153045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:11:43+00:00 2026-06-17T12:11:43+00:00

I am trying to network my collaborations through my publication network. I used igraph

  • 0

I am trying to network my collaborations through my publication network. I used igraph which is great for it. However, since I have edges from my vertex (the one representing me in the network) to all co-authors I end up with a pretty packed graph. I would like to remove edges from my vertex to some authors that are only related through another author. Basically authors where I was only co-authoring. Anyway, I have identified these vertices and I know my vertex. Now I can’t find a way to remove edges that link this set of edges to me only.

More generally how do you remove edges from 2 groups of vectors, such as V(g)[a] and V(g)[b]?

thanks,

here is an example:

au1 <- c('deb', 'art', 'deb', 'seb', 'deb', 'deb', 'mar', 'mar', 'joy', 'deb')
au2 <- c('art', 'deb', 'soy', 'deb', 'joy', 'ani', 'deb', 'deb', 'nem', 'mar')
au3 <- c('mar', 'lio', 'mil', 'mar', 'ani', 'lul', 'nem', 'art', 'deb', 'tat')


tata <- data.frame(au1, au2, au3)
xaulist2 <- levels(factor(unlist(tata[,])))
xaulist <- levels(as.factor(xaulist2))
xaulist_att <- c(rep('prime', 2), 'main', 'second', 'second', rep('prime', 3), 'second', rep('prime', 3))
au_att <- data.frame(au_name=xaulist, level=xaulist_att)

# matrix list preparation
tutu <- matrix(NA, nrow=length(xaulist), ncol=dim(tata)[1]) # row are authors and col are papers
for (i in 1:length(xaulist))
{
  for (j in 1:dim(tata)[1])
  {
  ifelse('TRUE' %in% as.character(tata[j,]==xaulist[i]), tutu[i,j] <- 1,  tutu[i,j] <- 0)
  }
}
tutu[is.na(tutu)] <- 0

tutu[tutu>=1] <- 1 # change it to a Boolean matrix
termMatrix <- tutu %*% t(tutu)

# build a graph from the above matrix
g <- graph.adjacency(termMatrix, weighted=T, mode = 'undirected')
g <- simplify(g) # remove loops
V(g)$label <- xaulist # set labels of vertices
V(g)$degree <- degree(g) # set degrees of vertices
V(g)[xaulist_att=='second']$color <- 'red'
V(g)[xaulist_att=='main']$color <- 'blue'
set.seed(112) # set seed to make the layout reproducible
plot(g)

So the question is how do you remove edges from authors that have attribute ‘second’ to the one that has attribute ‘main’, that is from the red ones to the blue one?

Thanks again,

  • 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-17T12:11:44+00:00Added an answer on June 17, 2026 at 12:11 pm

    Here is one way to do it, it think it is very readable:

    g2 <- delete.edges(g, E(g)[ V(g)[xaulist_att == 'second'] %--% 
                                V(g)[xaulist_att == 'main'  ] ])
    
    ## plot the results
    coords <- layout.auto(g)
    layout(rbind(1:2))
    plot(g, layout=coords, main="g")
    plot(g2, layout=coords, main="g2")
    

    See ?iterators for the details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add interactivity to a network graph I made in Gephi, which
I am trying to model a network using C++. I have a struct called
I am trying to implement a force directed network similar to this . However,
I'm trying to map network drive from windows service, I use batch file for
I'm trying to scan available wifi network through my Android device. Here's the chunk
I'm trying to copy some files from one network share to another using File::Copy.
I am trying to load an dll from network folder in my C# exe.
I'm trying to model a network of Person s. A Person can have many
I'm trying to implement an existing network protocol which makes heavy use of Unsigned
I'm trying to catch a network socket leak in our Java daemon, which has

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.