How are metric TSP and Eulerian cycle equivalent?

In paper : https://arxiv.org/pdf/1908.00227.pdf it is stated that

In the metric TSP problem, which we study here, the distances satisfy the triangle inequality. Therefore the problem is equivalent to finding a closed Eulerian connected walk of minimum cost.

They don’t seem to be equivalent at all, since for a complete graph of size 5, with all edge costs 1, a metric TSP solution would be of cost (and length) 5, whereas an Eulerian cycle would be of cost (and length) 10. Am I misunderstanding?

If I have an MST, and I add any edge to create a cycle, will removing the heaviest edge from that cycle result in an MST?


Let’s say that I have an MST, $ T$ . I pick an edge not in $ T$ and change its weight, and add it to $ T$ to create a cycle. Will removing the heaviest edge from that cycle result in an MST?

MST means minimum spanning tree of a graph. I came across these two posts:

  • https://stackoverflow.com/questions/13437702/how-to-get-the-new-mst-from-the-old-one-if-one-edge-in-the-graph-changes-its-wei
  • https://sudeepraja.github.io/MST/

and I follow both until the case where $ w_{old}>w$ and $ e\notin T$ . They both say that deleting the heaviest edge will guarantee an MST, but I don’t see how to prove that. The cycle property just says that IF you have an MST, it can’t have an edge which is the heaviest edge in a cycle of the original graph $ G$ ; it is NOT saying that IF you have a tree that doesn’t contain an edge that happens to be the heaviest edge of some cycle in the original graph $ G$ , you are an MST.

To make the question more explicit in terms of the problem it was trying to solve, I will copy a part of the first link:

If its weight was reduced, add it to the original MST. This will create a cycle. Scan the cycle, looking for the heaviest edge (this could select the original edge again). Delete this edge.

I don’t understand why this guarantees that we find an MST. Sure, we get a spanning tree but why does deleting this heaviest edge yield a MINIMUM spanning tree?

LP – given m constraints for 2 variables find maximal radius of cycle

Given $ m$ constraints for 2 variables $ x_1,x_2$ :

$ d_ix_1 + e_ix_2 \leq b_i$ for $ i = 1,…m$

need to create a linear program that finds the maximal radius of a cycle such that all the points inside the cycle are in the feasible range of the above constraints.

so I know the formula for distance between some $ (x,y)$ and some $ ax +by + c = 0$

then I have tried –

  • $ Maximal$ $ R$ s.t
  • $ d_ix_1 + e_ix_2 \leq b_i$ for every $ i$
  • $ R \leq |d_ix_1 + e_ix_2 – b_i| / {\sqrt{{e_i}^2 +{d_i}^2}}$ for every $ i$
  • $ R \geq 0$

I know the standard linear program doesn’t get absolute value function but obviously we can just have 2 inequalities to get rid of it.

what do you think? and how eventually I can the relevant $ (x_0,y_0)$ that will be the centre of the cycle which $ R$ is its radius are they going to be the specific $ x_1,x_2$ that will makes R maximal I guess?

A question about Pipeline Cycle

This is my question, I am so confused with my answer, looking for help! enter image description here

This is my answer: enter image description here However, the instructor said that if an instruction is waiting before ID, the next instruction of IF phase should be start at 6th instead of 3rd (what I did)

Therefore, I am looking for help and want someone to discuss and check the idea with me. Thanks a lot for help!

For instance, which of the two IF is appropriate?

A heuristic for finding an edge cycle cover

I am working on a problem that considers the list of cycles that a certain vertex belongs to in a graph! After computing all simple cycles with Johnson algorithm, I realized that I don’t need them all but instead, for every vertex, a list of cycles covering the edges of its cycles would be enough! I made few searches and found out there is the Edge Cycle Cover and finding the minimum is NP-HARD problem. I’m not sure if it is exactly what I’m looking for. Also, I don’t want to process all the simple cycles returned cause it may increase the global algorithm complexity.

So, any help understanding this problem? Is there a heuristic to get only a subset of cycles for each vertex in the graph? it does not have to be minimal!

How to tackle the Annual cycle?

We are experimenting with Annual cycle in our company for some workloads we have to repeat every week, month, year etc…

So far we have tried:

  • Teams calender

  • Microsoft Planner

  • Classic SharePoint Online Task list with Gantt (modern doesnt support Gantt)

  • Custom list in SharePoint Online (with some SPD and or Flow attached for the logic)

Anybody have any better suggestions we can try out inside the Microsoft umbrella? Only 2 stipulations

  1. It has to be OOTB functionality so no extra coding of any kind

  2. No 3rd party software

How to deal with parallel edges between two vertices in cycle detection using BFS in an undirected graph?

I am new to Programming and learning Algorithms and was studying BFS when I read that BFS could 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:

• Do a simple BFS Traversal using a Queue while maintaining the parent node of nodes enqueued in the queue.

• If I come across a node u that has a neighbor v such that v is already visited but v is not the parent of u then that means there is 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 is working except in cases when I have more than 1 edge between 2 vertices for e.g. in following case we have 2 edges between vertices 0 and 1:

Graph containing cycle

Adjacency list of above graph is: adjList = {0:[1, 2], 1:[0], 2:[0]}. Here we can clearly see that the graph contains a cycle but above algorithm is not able to detect the same because when BFS will reach vertex 1, vertex 0 is already visited but vertex 0 is also the parent of vertex 1 so this cycle will go undetected.

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

Edit: I tried the same logic on directed graphs also, and I am facing similar problem i.e. case when I have a directed edge from vertex 0 to vertex 1 and another directed edge from vertex 1 to vertex 0