+ - 0:00:00
Notes for current slide
Notes for next slide

PEER Advanced Field School 2023

Bipartite Networks

Eric Brewe
Professor of Physics at Drexel University

15 June 2023, last update: 2023-06-29

1 / 8

Let's check out bipartite networks

I took the network file we have been working on and did two things. 1. I exported it as a tibble, and 2. I added a new variable Ate_Garbage_Plate, and saved it as a csv file in the data folder. This is because we have to rebuild this as a bipartite graph.

2 / 8

Let's load this new csv

```r
bipartite_df <- read_csv(here("data", "bipartite_df.csv"))
```
3 / 8

Let's take a look at this

Bipartite Networks are sometimes known as affiliation networks.

In this example we might imagine that people who eat garbage plate (a Rochester classic), like to eat garbage plate together?

```r
glimpse(bipartite_df)
```
## Rows: 60
## Columns: 5
## $ name <dbl> 5106, 6633, 7599, 4425, 2495, 6355, 8810, 3877, 1554…
## $ AMPM <chr> "morning person.", "morning person.", "night owl.", …
## $ Dessert <chr> "Brownies", "I don't care for dessert.", "Ice Cream"…
## $ Pages <dbl> 350, 12, 300, 0, 264, 4, 289, 550, 349, 300, 424, 42…
## $ Ate_Garbage_Plate <dbl> 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0…
4 / 8

Let's make this a network

b_gr <- bipartite_df %>%
select(name, Ate_Garbage_Plate) %>%
as.matrix(.) %>%
graph.incidence(.) %>%
as_tbl_graph()
5 / 8

Let's treat this as a network

There are plenty of things you can do with a bipartite network, but mostly I focus on the projections.

b_gr %>%
bipartite_projection() -> b_gr

Notice that there are two projections, one which is a person-person projection with 60 nodes, one that is a network of Garbage Plate eaters with 2 nodes.

6 / 8

Let's look at the person-person network

First, the person-person network

p_gr <- b_gr$proj1
p_gr %>%
ggraph(.) +
geom_edge_link(alpha = .25, aes(width = weight)) +
geom_node_point() +
theme(legend.position="bottom")

Ugh...way too dense! We need to do some sort of data reduction. That is a different class. But...

7 / 8

Let's do some data reduction

One common way is to identify the backbone of the network (again, there a bunch of ways to do this, so let's choose an easy one. )

p_gr %>%
ggraph(., layout = 'backbone') +
geom_edge_link(alpha = .25, aes(width = weight)) +
geom_node_point() +
theme(legend.position="bottom")

...and it doesn't look different (likely because as Rebeckah pointed out is because this is based on a random variable)

8 / 8

Let's check out bipartite networks

I took the network file we have been working on and did two things. 1. I exported it as a tibble, and 2. I added a new variable Ate_Garbage_Plate, and saved it as a csv file in the data folder. This is because we have to rebuild this as a bipartite graph.

2 / 8
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow