private bool bothHave(EdgeValues <T> edVal, Graph <T> grph) { bool start = grph.searchVertex(edVal.startId); bool end = grph.searchVertex(edVal.endId); if (start && end) { return(true); } return(false); }
// recursively edgeleri okuyup addedges yapan algoritmayı yaz. private bool onlyOneHave(EdgeValues <T> edVal, Graph <T> grph) { bool r = false; bool start = grph.searchVertex(edVal.startId); bool end = grph.searchVertex(edVal.endId); if (start && !end) { return(true); } else if (!start && end) { return(true); } return(false); }
private void travelEdges(Graph <T> grph) // graphtaki tüm edgeleri dolaşarak listeye sıralı olarak ekliyor. { edgeList = new LinkedList <EdgeValues <T> >(); Vertex <T> iteratorV = grph.head; while (iteratorV != null) { Edge <T> iteratorE = iteratorV.EdgeLink; while (iteratorE != null) { var edVal = new EdgeValues <T>(iteratorV.Id, iteratorE.VertexId, iteratorE.Weight); addEdges(edVal, grph); iteratorE = iteratorE.Next; } iteratorV = iteratorV.Next; } }
private void addEdges(EdgeValues <T> edV, Graph <T> grph) { var newNode = new Node <EdgeValues <T> >(edV); edgeList.addSorted(newNode); }