Shortest cycles in undirected graphs

Find the shortest cycle that contains a particular vertex on an undirected (and unweighted) chart $ s $It is usually said that a BFS is running $ s $ and the first time to find another visit, this is the smallest cycle length you want.

This does not seem to be true, quoted from https://www.cs.princeton.edu/courses/archive/spr08/cos226/exams/fin-f05-sol.pdf page 3:

Keep this in mind when you run BFS from $ s $ and stop once you visit a again
You may not get the vertex (using a previously unused edge)
shortest path contains $ s $,

Examples where this technique seems to be suggested: An efficient algorithm to find a shortest cycle including a specific vertex

Another technique, in which the shortest cycle in the entire diagram is determined by executing BFS from each vertex, seems to recognize only the shortest length +1 in a special case, as mentioned in this document: https: // link. springer.com/chapter /10.1007/978-3-540-78773-0_63 in the "unweighted case". on the other handHere (http://theory.stanford.edu/~virgi/cs267/lecture3.pdf) it is mentioned (first and second paragraph) that executing BFS results in every case from each vertex the shortest length (circumference). This is also mentioned in an archive (http://web.archive.org/web/20140513212046/https://webcourse.cs.technion.ac.il/234247/Winter2003-2004/ho/WCFiles/Girth.pdf) , ,

Which of all algorithms / methods applies to:

  1. Can you find the cycle with the shortest length in an undirected diagram?
  2. Find the shortest length cycle that passes through a known vertex $ s $ in an undirected graph?
  3. Where is the trap in each of my comparisons and contrasts above? (I can't believe some of the above are even wrong …)

Note: A randomized sub-cubic algorithm appears to exist in Raphael Yuster's publication "A shortest cycle for each vertex of a graph": http://research.haifa.ac.il/~raphy/papers/all-cycles .pdf

Algorithms – How to check if given $ k $ vertices efficiently create a $ k $ clique in an undirected graph $ G $

To let $ G = (V, E) $ Let be an undirected graph with a set vertex $ V $ and edge set $ E $, To let $ V & # 39; = {v_1, v_2, …, v_k } $ be a subset of $ V $ where degrees of each $ v_i $ is greater than or equal to $ k $, Is there a way to check if $ V & # 39; $ is a $ k $-clique more efficient than the brute-force algorithm in $ O (k ^ 2) $? Thank you in advance.

Algorithms – Given undirected and connected graph G = (V, E). Prove for each DFS run: for each u, v∈V, if u.d> v.d, then u.d -v.d≥δ (u, v)

Given undirected and connected graph $ G = (V, E) $,
Prove for each DFS run: for each $ u, v in V $ if $ u.d> v.d $ then $ u.d – v.d ≥ δ (u, v) $

$ δ (u, v) $-Distance of a shortest path (not necessarily unique) in G

$ u.d, vd $Time when each vertex was first discovered in DFS.

I know that DFS does not necessarily return the shortest path. And I know that when $ u.d> v.d $ then $ u $ discovered after $ v $. $ v ≠ u $ and there is path DFS between vertices, because G is connected.

I tried to accept that by contradiction
$ u.d-v.d <δ (u, v) $

Provided G is connected and $ v.d <u.d $, Then $ v $ discovered before $ u $ and $ u ≠ v $,
$ u.d-v.d $ Sets the distance of a path from $ u $ to $ v $ in the $ G_π $,
After our assumption this distance is then smaller $ δ (u, v) $ And that contradicts the fact that $ δ (u, v) $ is the distance of a shortest path (not necessarily unique) in G.

But this prof is not full. Why can we say the "punch line"?

How do I handle BFS in cycle recognition with an undirected graph with parallel edges between two vertices?

I am new to programming and learning algorithms and have studied BFS when I read that BFS can be used for cycle detection. I tried to implement the same on an undirected graph G with Adjacency List Representation.
What I did is as follows:

• Perform a simple BFS traversal using a queue while preserving the parent node of the queued node.

• When I come across a knot u that has a neighbor v so that v but already visited v is not parents of u then that means there is a cycle in the graph.

pseudocode:

#adjList is the adjacency list given as a dictionary
#myQueue is a double-sided queue containing node and its parent node ((Node, parNode))
#visited is a set containing visited nodes

while(myQueue):
    currNode, parNode = myQueue.pop() #dequeue operation
    visited.add(currNode) #Marking currNode as visited
    for childNode in adjList(currNode): #Traversing through all children of currNode
        if currNode not in visited:
            myQueue.appendleft((childNode, currNode)) #Enqueue operation
        else:
            if childNode!=parNode: #Main logic for cycle detection
                print('CYCLE DETECTED')
                break

The above approach works except in cases where I have more than one edge between two vertices, e.g. In the following case we have 2 edges between vertices 0 and 1:

Graphic with cycle

The adjacency list of the above diagram is: adjList = {0:(1, 2), 1:(0), 2:(0)}, Here we can clearly see that the graph contains a cycle, but the above algorithm is unable to detect it because the time at which BFS reaches the vertex 1vertex 0 But already visited vertex 0 is also the parent of Vertex 1 so this cycle will go undetected.

My question is how can I change the above algorithm to detect such cases?

To edit: I've tried the same logic on directed graphs and I'm facing a similar problem. H. The case of having a directed edge from the vertex 0 to the vertex 1 and another directed edge from the vertex 1 to the vertex 0

Representation theory – undirected Alexander polynomial

Take the tangled relationship of the Alexander polynomial: $ S ^ 1-S ^ {- 1} -zS ^ 0 = 0 $, where z is the parameter of the Alexander polynomial and $ S $ the crossover mesh element. Multiply the equation with an overcross or undercross to get new ones. To repeat. Multiply all these equations by a coefficient and add them together. All you have to do is call "Dimension" 8 to do the following: If the coefficients are chosen correctly, you can flip one of the arrows and the equation will remain valid. It looks like $ (S ^ 4 + S ^ {- 4} -2 * S ^ 0) + (S ^ 2 + S ^ {- 2} -2 * S ^ 0) (z ^ 2 + z ^ {- 2}) ^ 2 = 0 $, This is what I call the undirected Alexander polynomial (since it can be calculated without instructions for a link).
You can now ask, "Hey, does this string equation uniquely define a compound polynomial?" But I also have an accompanying S-matrix of the dimension $ 4 ^ 4 $ (which is a bit too big to post here) that meets the usual conditions and this equation.
My question is whether this polynomial is well known and, above all, which Lie algebra is associated with it $ A_1 $ with the Kauffman – so the rt day).
(Background: I have identified all charge-preserving S-matrices of the dimension $ <= 4 $ and the associated lying algebras, except this one.)

Forward edges in undirected graphs with FSO

Introduction to Algorithm Books claims that BFS classifies an edge for an undirected graph only as a tree or cross edge. But how about this simple example below, in which, of course, front edges occur?

Given graph with only 2 vertices A and B and 3 edges from A to B!

Exploration of adjacent vertices

(1) A-> B (tree edge, A is now marked as ancestor for B and B is A's offspring)

(2) A-> B (leading edge? B has not been edited yet (gray) and we have found an edge from his ancestor (A))

(3) A-> B-forward edge with the same reason as in (2)!

What do I miss here?