title: r igraph: remove edges from 2 groups of vectors
body: <p>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.</p>
  
  <p>More generally how do you remove edges from 2 groups of vectors, such as V(g)[a] and V(g)[b]?</p>
  
  <p>thanks,</p>
  
  <p>here is an example:</p>
  
  <pre><code>au1 &lt;- c('deb', 'art', 'deb', 'seb', 'deb', 'deb', 'mar', 'mar', 'joy', 'deb')
  au2 &lt;- c('art', 'deb', 'soy', 'deb', 'joy', 'ani', 'deb', 'deb', 'nem', 'mar')
  au3 &lt;- c('mar', 'lio', 'mil', 'mar', 'ani', 'lul', 'nem', 'art', 'deb', 'tat')
  
  
  tata &lt;- data.frame(au1, au2, au3)
  xaulist2 &lt;- levels(factor(unlist(tata[,])))
  xaulist &lt;- levels(as.factor(xaulist2))
  xaulist_att &lt;- c(rep('prime', 2), 'main', 'second', 'second', rep('prime', 3), 'second', rep('prime', 3))
  au_att &lt;- data.frame(au_name=xaulist, level=xaulist_att)
  
  # matrix list preparation
  tutu &lt;- 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] &lt;- 1,  tutu[i,j] &lt;- 0)
    }
  }
  tutu[is.na(tutu)] &lt;- 0
  
  tutu[tutu&gt;=1] &lt;- 1 # change it to a Boolean matrix
  termMatrix &lt;- tutu %*% t(tutu)
  
  # build a graph from the above matrix
  g &lt;- graph.adjacency(termMatrix, weighted=T, mode = 'undirected')
  g &lt;- simplify(g) # remove loops
  V(g)$label &lt;- xaulist # set labels of vertices
  V(g)$degree &lt;- degree(g) # set degrees of vertices
  V(g)[xaulist_att=='second']$color &lt;- 'red'
  V(g)[xaulist_att=='main']$color &lt;- 'blue'
  set.seed(112) # set seed to make the layout reproducible
  plot(g)
  </code></pre>
  
  <p>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?</p>
  
  <p>Thanks again,</p>