I need to create a randomized graph with a fixed number of vertices. I have difficulty getting a solution every time.
Schedule Rules
- Each vertex will have a random number of connections, which is no more than N-1, where N is the total number of vertices.
- Vertices cannot contain direct connections to themselves
- Vertices cannot contain duplicate connections with other vertices.
- If vertex A is connected to Vertex B, then Vertex B must connect to vertex A.
- Each vertex must connect to at least three other vertices. Therefore, each vertex will be located between the edges [3, N-1].
I get the right solution in about 70% of cases, but in other cases I get quite far to the schedule, after which there are no true vertices. What constraints for vertex connections are needed to guarantee a solution?
What am i doing so far
- Randomize multiple joints for each vertex between [3, N-1].
- Make sure the total number of connections is even. If A points to B and B points to A, then the total number of connections on the graph should be even, or there is no solution. If it is odd, change the vertex so that the total number is even.
- Fill in all the vertices that are completely bounded. Thus, a vertex with N-1 connections should point to ALL other vertices. Fill the connection from this vertex to all the others and give all other vertices a connection with completely limited ones.
- , . , N-2 , N-3-, N-4 .. .
- , , , , , . ( 7-15 , ).
, , , . , . - , ?
, , , , , , .