public VertexWirth(int key, int count, VertexWirth next, EdgeWirth trail) { Key = key; this.count = count; Next = next; Trail = trail; }
public VertexWirth(int key, int count, VertexWirth next, EdgeWirth trail, object data = null) { Key = key; this.count = count; Next = next; Trail = trail; Data = data; }
public bool DeleteDirectEdge(int from, int to) { var f = Find(from); if (f == null) { return(false); } var t = Find(to); if (f == null) { return(false); } EdgeWirth previous = null; var edge = f.Trail; while (edge.Next != null) { if (edge.Id.Key == t.Key) { var next = edge.Next; if (previous == null) { if (next == null) { f.Trail = null; } else { f.Trail = next; } } else { if (next == null) { previous.Next = null; } else { previous.Next = next; } } return(true); } previous = edge; edge = edge.Next; } return(false); }
private bool DeleteDirectEdge(VertexWirth f, VertexWirth t) { EdgeWirth previous = null; var edge = f.Trail; while (edge != null) { if (edge.Id.Key == t.Key) { if (!edge.Direct) { return(false); } var next = edge.Next; if (previous == null) { if (next == null) { f.Trail = null; } else { f.Trail = next; } } else { if (next == null) { previous.Next = null; } else { previous.Next = next; } } return(true); } previous = edge; edge = edge.Next; } return(false); }
public EdgeWirth(VertexWirth id, EdgeWirth next, int weight, bool direct) : this(id, next, weight) { Direct = direct; }
public EdgeWirth(VertexWirth id, EdgeWirth next, int weight) : this(id, next) { Weight = weight; }
public EdgeWirth(VertexWirth id, EdgeWirth next) { Id = id; Next = next; }