графы

Directed graph with distances

Hi everyone) How can I implement a graph oriented with vertex distances. I.e ., the input is vertex A, vertex B, and the distance between them is 6. And B C is the distance between them is 3. And A C the distance between them is 1.

Undirected Python graphs. The incidence matrix

An undirected graph is set from a file in the form 6 5 1 2 3 2 4 1 3 4 5 2 Where the first row is the number of vertices ... x[i],0) self.ui.label_2.setText(str(self.matrix)) How to find the incidence matrix with edges and adjacency matrix?

The task of the Chinese postman. Finding the Euler cycle

At the university, they were asked to solve the problem of the Chinese postman.Here is the algorithm for solving it. We loo ... length; i++) { if (matrixAdjacency[edge][i] > 0) { return i; } } return -1; }

algorithm for finding all paths between two vertices without repetitions in the digraph

Please help me make an algorithm for finding all paths between two vertices (vertices should not be repeated in paths), prefe ... alue; func += FindDirectWays(graph, vertex.Vertex, Y); } } return func; }

c++, graphs, from adjacency matrix to incidence matrix, undirected graph

Please help me how to go from the adjacency matrix to the incidence matrix, I have already gone through everything and have n ... lt;< G[i][j] ; } cout << endl; } cout << endl; return 0; system("pause"); }

Practical application of the clique?

In graph theory, a clique of an undirected graph is a subset of its vertices, such that any two vertices of the subset are co ... puter network, another network, or even something that can be represented as a graph the need to search for this very clique?

Proof of the correctness of Kuhn's algorithm for finding the maximum matching

Many places write that its correctness obviously follows from Berge's theorem. However, it is not clear why, if the increasing chain exists, the algorithm will find it?

Implementation of the algorithm for finding the shortest path in width on JS

const graph = { you: ['alice', 'bob', 'claire'], bob: ['anuj', 'peggy'], alice: ['peggy'], claire: ['thom'] anuj: [ ... ot understand how to save the shortest path. it would be interesting to see solutions for the directed and undirected graph.

Ford-Bellman algorithm-path recovery

The course program requires a software implementation of this algorithm. But I'm stuck at the stage of restoring the path alo ... = 0; i < array.size(); i++) { if (min > array.get(i)) min = array.get(i); } return min; }

Java: graph visualization

I want to play around with graph visualization in java. Goal: to get your hands on java. Can you tell me which graphics library is suitable for this?

the incidence matrix to the adjacency matrix of an edge graph

It is necessary to transform the edge graph from the incidence matrix to the adjacency matrix. for those who do not understan ... < endl; } cout << endl; //end _getch(); }

Finding and visualizing the shortest path between graph vertices

I have a graph, let's say, of five vertices. And I need to find the shortest path from one vertex to another using the Floyd ... hat are included in the shortest path. That is, I need to get this list: result = [[0, 2], [2, 1]] Example in the photo:

The fastest implementation of Dijkstra's algorithm in javascript

A weighted graph is given. You need to solve 2 problems: find the length of paths from the starting point to all points and a ... tions that I have attached links to above, and from these optimizations they will work quickly, I will also be very grateful!

Error in the implementation of Dijkstra's algorithm

I wrote Dijkstra's algorithm for a directed graph. The essence of this named example is that it finds the most likely success ... n range(M): matrix2[int(matrix[i][0]-1)][int(matrix[i][1]-1)] = matrix[i][2] print(Dijkstra(N, begin-1, matrix2,end-1))

Deep search implementation

Hello. I have a problem with elementary depth-first search.I just started learning graphs and can't implement it. Here is the ... i]) dfs(*i); } int main() { n = 4; int i; for (i = 1; i <= n; ++i) { dfs(i); } }

How to organize unstructured data?

So, you need to organize unstructured data in such a way that on the basis of this data you can build an Entity-Relationship ... ties of another a non-unique entity based on the principle of the totality of information (as in the example with "Anton") ?

How to check the degeneracy of a matrix

A perfect match in a graph exists if and only if the determinant of the adjacency matrix of the graph is nonzero. It is neces ... the answer may be incorrect due to rounding. Question: how else can we check the degeneracy of a matrix quickly using python?

Is the graph a tree [closed]

Closed. It is impossible to give an objective answer to this question . Answers to it are not accepted at the moment. ... } bool IsTree( int arr[SIZE][SIZE] ) { return is_rec(arr,0,0,0); } I think some people will be interested in solving :)

How do I come up with (or create a generator) conditions for the problem of finding a path on a checkered field?

There is a checkered field, like in chess. In some cells there are special chips that indicate gas stations. In one cell ther ... hat is the algorithm) such an arrangement of all the elements that it is difficult for another person to solve, but solvable?

Dijkstra's algorithm for finding the shortest path

The graph in the problem is undirected. How do I turn off some edges so that the user can choose which edges they don't need ... << " "; cout << "\nWeight : " << pos[n - 1] << "\n"; cout << endl; return 0; }