i want to show that for an example graph family the nummer of connected subgraphs grows expnential with n.
That is easy to show for a complete graph, because a complete graph has
n(n-1)/2 = n over 2
edges. One edge is either in the subgraph or not. Therefore, every subgraph can be enumerated with a binary number of the length
2^(n over 2)
and because its a completed graph, every subgraph is connected.
But lets assume for example we want to show that the number of connected subgraphs in a 3- or 4-regular graph grows also exponential. We can enumerate the subgraphs in the same manner. But we have to exclude a lot of them, because they are not connected.
How can we do that? Is there a way to distinguish all connected subgraphs from the not connected ones?
Greetings and thanks for your thoughts
This idea is easy to prove for certain families of graphs, and in particular families of graphs with a high "Edge-Connectivity" (see https://en.wikipedia.org/wiki/K-edge-connected_graph).
For an edge-connectivity greater than k, you can always choose any k vertices for removal and generate a connected graph. Hence, you get at least Summation(j = 1 .. k; E-choose-k) graphs where E is the total number of edges. Let k > (E/m) for some constant m.
Then indeed, the number of sub-graphs will grow exponentially.
Related
Could someone explain in pretty simple words why the normalization of many network analysis indicies (graph theory) is n(n - 1), where n – the graph size? Why do we need to take into account (n - 1)?
Most network measures that focus on counting edges (e.g. clustering coefficient) are normalized by the total number of possible edges. Since every edge connects a pair of vertices, we need to know how many possible pairs of vertices we can make. There are n possible vertices we could choose as the source of our edge, and therefore there are n-1 possible vertices that could be the target of our edge (assuming no self-loops, and if undirected divide by 2 bc source and target are exchangeable). Hence, you frequently encounter $n(n-1)$ or $\binomal{n}{2}$.
Find the minimum number of nodes that needs to be removed to make graph disconnected( there exists no path from any node to all other nodes). Number of nodes can be 105
First of all, to find a node that is not needed to make the graph connected, you need to find a cycle. Once you find a cycle, then you know all those edges in those cycle are not needed. All the remaining edges in the graph are needed to hold the graph together, so you do a simple traversal of the graph and count the number of vertices connected to find the minimum number of nodes that needs to be removed to make graph disconnected. I'm not sure if this is the most efficient way, just the most efficient in my head. If V is the number of vertices and E is the number of edges, the time complexity will be somewhere around O(V + E) + O(V), since the initial cycle finding is O(V + E) and the counting of the nodes is O(V). Since E >= V, the time complexity can be rounded to O(E), but with huge constant factors.
Consider the graph undirected.
totalDegree = sum of degree of all nodes.
while(totalDegree > 0) {
Remove the node with highest degree and it's edges.
Update degree count of each node.
totalDegree = sum of degree of all remaining nodes.
}
remaining nodes are all disconnected
Trying to think of a case where it will not give the min number of nodes.
I was solving this CLRS problem, which asked to find out the indegree of every vertex of a graph G(V,E). I found out the solution to be O(|E|) as we only have to scan through all the edges to find out the degrees of all vertices.
But most of the solutions, I found online, say that it is O(|V|+|E|). How come? How are the vertices accounting for the time taken?
If we suppose that the implementation of the digraph uses objects for vertices and each vertex has an associated list of successors and no additional data structures, then it will be impossible to iterate the edges directly.
If the digraph is connected, then each vertext has at least one associated edge. This means that iteration over the edges via iteration over the vertices takes O(|E|) time - the iteration over the vertices does not increase the running time, which is dominated by the number of edges.
If the digraph is not connected, then the iteration over the vertices is not necessarily dominated by the number of edges; even isolated vertices have to be processed just to find out that they have no associated outgoing arcs, which can be done in O(|V|+|E|) time.
In total, the runtime bound of O(|V|+|E|) is correct in either case; however, for a connected digraph (or an implementation which permits direct iteration over the edges regardless of the number of vertices) one can obtain a tighter runtime bound of O(|E|).
I got a little riddle concerning graphs.
In this case it is forbidden that 3 nodes are directly connected to each other. In other words, you cannot create 3 connections between 3 nodes which would create a triangle (each corner is a node and the edges are the connections)
Prove that the biggest possible amount of connections is n² when we got 2*n nodes. Also prove that this condition is realizable for each n.
n is part of the positive natural numbers.
To answer the question in part, one can prove that the number n*n is realizable can be solved by the following proof sketch, where induction on n is used. For n=0 the graph is empty, for n=1 the graph is a straight line and for n=2 the graph is a square. For the induction step, let n be arbitrary such that there is a graph with 2n nodes which has n*n edges and is triangle free. To understand the idea of the proof, imagine the graph arranged in two rows of n nodes each. Add two nodes as a column right to this graph, creating a graph with n+2=2(n+1) nodes. Connect these nodes to each other, creating 1 new edge.
Connect the upper new node to the columns left of it, alternating between upper and lower row, starting in the upper row. This creates n edges. Likewise, connect the lower new node to the columns left of it, alternating between upper and lower row, starting in the upper row. This creates n edges. In total, the construction does not create a triangle.
In total, 2*n+1 new edges were created. In total, the graph has n*n+2*n+1=2*(n+1) edges, which is the desired amount.
I want to generate a sequence of the number of vertices in all graphs which each edge has the same number of leaving edges. I dont have to generate the whole sequence. Let's say the first 50 if exists.
I want:
Input: the number of edges leaving each vertex
Output: a sequence of the number of vertices
So far, I have looked at complete graphs. Complete graphs with n vertices always have n-1 edges leaving each vertex. But there are other kinds of graphs that have this property. For example, some polyhedrons, such as snub dodecahedron and truncated icosidodecahedron have this property.
How should I approach my problem?
I think you mean regular graphs:
http://en.wikipedia.org/wiki/Regular_graph
http://mathworld.wolfram.com/RegularGraph.html
I made a regular graph generator which isn't flawless by the way:
once you generate the nodes, say from 1 to n. You want regularity r.
For node 1, make connections to the following nodes until you reach degree r for node 1.
For node 2 you already have degree 1 (because of node 1), you connect again to further nodes until you reach degree r for node 2 too. And this way till the last node.
The flaw is that you can't define an r-regular graph for any number of nodes. The algorithm mentioned doesn't detect that, so some errors may occur. Also, this isn't a random r-regular graph generator, but instead give one possible solution.
I'm not much of an explainer, so please ask if the description lacks somewhere.