It is necessary to write an application in C # that allows the user to define a metric graph (all edges are oriented in any direction and have a length, there are multiple edges, that is, several edges between the same pair of vertices, there are loops, that is, an edge from vertex to itself ), that is, mark points on the plane, connect some of them and indicate the lengths of the edges. The output should be a file in which you specify:

  1. The size of the work area (you can also change it)
  2. Vertex coordinates
  3. A list of edges with their lengths and an indication of the vertices that they connect

It seems that I could not find a normal library that can satisfy my needs, so, apparently, I have to write it myself. My skills in designing graphic applications are limited to creating not very complex WinForms applications, so I ask you to give me a direction to learn (perhaps there is something in WPF that can help me).

  • 2
    This can be done even on WinForms, even on WPF. But you have to write everything manually - to draw vertices with circles, edges with lines, while dragging the point to redraw all lines going into it, etc. - VladD

2 answers 2

On github, there is a Microsoft Automatic Graph Layout ( MSAGL ) project that allows you to create graphs in WinForms, for example, such as:

enter image description here

    This link: https://vscode.ru/prog-lessons/programma-dlya-postroeniya-grafov.html is a decently written program for drawing graphs. I based on it made an example of constructing the visibility graph and the dextra algorithm. Having a little skill you can add the functions you need there. I would recommend using Winforms. As it seems to me, they are still simpler. No need to go into xaml.