I have data on the cooperation of inventors on patents. Each inventor is a node, each rib represents a patent, according to which two inventors collaborated. Some patents are> 2 inventors, so some patents are presented with several edges.
I want to sign patents where at least one inventor is in BOISE, but not all inventors are in BOISE. Other patents and inventors should be excluded from the selection.
For instance:
gg <- graph.atlas(711) V(gg)$name <- 1:7 V(gg)$city <- c("BOISE","NEW YORK","NEW YORK","BOISE","BOISE","LA","LA") V(gg)$color <- ifelse(V(gg)$city=="BOISE", "orange","yellow") gg<-delete.edges(gg, E(gg, P=c(1,2,2,3,2,7,7,6,7,3,3,4,3,5,4,5,5,6,6,1))) gg <- add.edges(gg,c(1,4,4,5,5,1),attr=list(patent=1)) gg <- add.edges(gg,c(7,5,5,4,4,7),attr=list(patent=2)) gg <- add.edges(gg,c(7,3,3,5,5,7),attr=list(patent=3)) gg <- add.edges(gg,c(2,7,7,6,6,2),attr=list(patent=4)) gg <- add.edges(gg,c(6,4),attr=list(patent=5)) plot(gg, edge.label=E(gg)$patent)
Produces:

From this network, I only want to highlight all the nodes that are on the edges of the patent 2, 3, 5.
In this example, node 1 should not fall into a subgraph. You should also exclude the rib from node 5 to node 4, relating to patent No. 1.
I have been struggling with this problem for some time. Is it possible to do this?