Draw Network in R (control edge thickness plus non-overlapping edges)

后端 未结 4 857
醉话见心
醉话见心 2021-01-30 15:27

I need to draw a network with 5 nodes and 20 directed edges (an edge connecting each 2 nodes) using R, but I need two features to exist:

  1. To be able to control the
4条回答
  •  广开言路
    2021-01-30 15:32

    The 'non overlapping' constraint on edges is the big problem here. First, your network has to be 'planar' otherwise it's impossible in 2-dimensions (you cant connect three houses to gas, electric, phone company buildings without crossovers).

    I think an algorithm for planar graph layout essentially solves the 4-colour problem. Have fun with that. Heuristics exist, search for planar graph layout, and force-directed, and read Planar Graph Layouts

提交回复
热议问题