please format code with </> button * homework policy * asking questions

Hello,

we have to implement the Dijkstra Algorithm. But at the beginning you have an empty field where you can click to create the nodes and edges between the nodes. In MousePressed we have implemented the nodes, but we dont know how we can connect two nodes with a line. Furthermore we dont really know how we can distinguish betwenn drawing a node or an edge in the funktion mousePressed.

Maybe there is someone who can help us!!

```
void setup() {
size(400,400);
}
void draw() {
}
void mouseClicked(){
// wenn Stelle noch nicht belegt
Node node= new Node();
// wenn an der Stelle ein Knoten ist
// -> Kante ziehen
}
static class Zaehler{
static int knotennummerzaehler = -1;
}
class Node extends Zaehler{
// number inside the node
int knotennummer;
// neuen Knoten erstellen
Node(){
hochzaehler();
fill(0);
ellipse(mouseX,mouseY,50,50);
fill(255);
textSize(20);
text(knotennummer,mouseX,mouseY);
}
void hochzaehler(){
// number increases
knotennummerzaehler ++;
knotennummer = knotennummerzaehler;
}
}
class Edge{
Edge(){
fill(0);
line(mouseX, mouseY,0,0);
}
}
```