Relative Content

Tag Archive for rigraph

Adding edge to an `igraph` in `R`

There are a few similar posts (like this one and this too), but my question might be more basic for the igraph package functionality.

Smallest Circle Containing Half the World’s Population

I was reading about this over here: https://en.wikipedia.org/wiki/Valeriepieris_circle . This is a problem where the task is to find the smallest possible circle that contains half of the world’s population. I am trying to replicate this task myself as a learning exercise.

Conditional labeling vertices in a graph’s connected component – igraph R

I have a connected component in a graph and I need to convert it into a data frame. Each vertex should be assigned a unique label based on its position or path within the graph. For instance, vertices A1 to A3 should share the label A, and vertices C1 to C3 should share the label C. The criteria for labelling is that the path terminates either before a vertex with two incoming edges or at a vertex with two outgoing edges. The images also the expected number of labels, i.e., 7.