I am interested in two problems, which seem to be related, solving each will advance me in other possible directions.
In both problems, $G=(V,E)$ is a positively-weighted undirected graph. Denote its weight function by $w$.
Having $w$, a weight-distance between $2$ vertices is the smallest sum of weights on a path between these vertices. The edge-distance is simply the number of edges between them, on a path that will ignore the weight function and will only count the number of edges.
The first problem: For any $v\in V$, find the weight-distance to all $u\in V$ such that there exists a vertex $z\in V$ for which: $(v,z)(z,u)\in E$. Basically, its like All-Pairs Shortest Path, just for pairs of vertices within edge-distance exactly $2$. Only these pairs are of interest to me, and I would like the algorithm to be as nearly to quadratic time as possible (Say, $|V|^{\frac{5}{2}}$ is already inefficient for me).
My attempt was a sort of Dijkstra combined with a BFS (or the first two levels of a BFS tree), but this leads to $|E|$ time, which makes it $|V||E|$, which is way inefficient for me.
The second problem might be even harder. Consider $G$. The weight of a triangle is simply the sum of its' edges' weights. I want to find for each vertex its minimal weight triangle. As I am not attempting to enumerate all triangles, I do believe this can be solved faster than $|E|^{\frac{3}{2}}$ for triangle enumeration.
For this problem, I have considered attempting a degeneracy-based approach, by trying to sort edges and disqualifying edges that are "too heavy" - but this never gave fruit to an actual algorithm. The total runtime here should also likely be $|V|^2$ or very near, $|V|^{\frac{5}{2}}$ is too heavy.
I suspect the second problem I presented might be even harder then the first, therefore I am not aware if such algorithms can be made, or if it would apply certain other problems are too easy from what they are believed to be.
A general note is that the graph might be dense, so $|V||E|$ is too much time for either one.
Additionally, I would like to avoid matrix multiplication algorithms, yet if the runtime (without MM) is an expected runtime, that is acceptable, as I believe having a deterministic algorithm without MM might be too hard. So a random algorithm (without MM) with an expected runtime of as near $|V|^2$ as possible is also efficient.