Skip to content

Instantly share code, notes, and snippets.

@jinhangjiang
Last active June 24, 2021 08:16
Show Gist options
  • Save jinhangjiang/236b656ccd0870bfcfe87e6cdb0010d9 to your computer and use it in GitHub Desktop.
Save jinhangjiang/236b656ccd0870bfcfe87e6cdb0010d9 to your computer and use it in GitHub Desktop.
igraph graph.formula
## Create undirected graphs
g <- graph_from_literal(1-2, 1-3, 1-7, 3-4, 2-3, 2-4, 3-5, 4-5, 4-6, 4-7, 5-6, 5-8, 6-7, 7-8)
## Create directed graphs using addition or substraction operators
dg <- graph_from_literal(JFK-+PEK, JFK-+CDG, PEK++CDG)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment