Find longest path in graph with N nodes and N edges
The greedy solution is not correct.

Let me construct a graph with $5$ vertices, $A$, $B$, $C$, $D$, $E$. 

$AB$ is an edge with weight $1$. 

$BC$ is an edge with weight $2$. 

$AC$ is an edge with weight $2$. 

$AD$ is an edge with weight $100$. 

$CE$ is an edge with weight $100$. 

The longest (heaviest) path is $DABCE$ with weight $203$. After removing $AB$, which is the lightest edge of the cycle $ABC$, the longest path is $DACE$ with weight $202$.