Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

In graph theory, there are algorithms that find the shortest path between two nodes. I made one with pure CSS (including the graph drawing). Drag the nodes, and the shortest path will update in real-time! A demo powered by all the modern CSS features🤩

1,202,160 Aufrufe • vor 7 Monaten •via X (Twitter)

42 Kommentare

Profilbild von Samiullah Khan
Samiullah Khanvor 7 Monaten

Should I stop my search for good force graph JavaScript library and use this instead

Profilbild von CSS by T. Afif
CSS by T. Afifvor 7 Monaten

Not really. It's kind of a static implementation tailored to that particular graph. I am still missing features to be able to create a generic algorithm but it will happen in the future 😉

Profilbild von ._.
._.vor 7 Monaten

pffffff… are youn human? 🧐

Profilbild von CSS by T. Afif
CSS by T. Afifvor 7 Monaten

Now that many are hating AI more and more, I'd rather be a human 😅

Profilbild von ._.
._.vor 7 Monaten

😆😆😆

Profilbild von CSS by T. Afif
CSS by T. Afifvor 7 Monaten

In case you want more CSS fun👇

Profilbild von Marchen
Marchenvor 7 Monaten

pure css doing graph theory. wild

Profilbild von David K 🎹
David K 🎹vor 7 Monaten

This is insanely cool

Profilbild von SolusOps
SolusOpsvor 7 Monaten

is CSS Turing complete now?

Profilbild von Amphlux.ye
Amphlux.yevor 7 Monaten

I submit 1571 as my top score

Profilbild von Kris des Chacals ∞
Kris des Chacals ∞vor 7 Monaten

Next step: solve the travelling salesman problem with CSS 😄

Profilbild von Andy
Andyvor 7 Monaten

You are stacked and overflowing with talent.

Profilbild von Nakumbo
Nakumbovor 7 Monaten

I’m sorry for breathing the same air with you or ever opening a computer 😭

Profilbild von IGuano
IGuanovor 7 Monaten

is this just running dijkstras

Profilbild von rifusaki (woke izutsumi)
rifusaki (woke izutsumi)vor 7 Monaten

data analysis idea @ohsweetnothin

Profilbild von SuperKreator
SuperKreatorvor 7 Monaten

@DaegoDaeki espabila

Profilbild von huehue
huehuevor 7 Monaten

Are you real ?

Profilbild von Starálfur
Starálfurvor 7 Monaten

CSS gone wild.

Profilbild von D7460N
D7460Nvor 7 Monaten

This is amazing dude. Great job.

Profilbild von Josh
Joshvor 7 Monaten

@samwhoo Very very cool!

Profilbild von ultimatepissmaxerpissmaximizerpisscollector8000
ultimatepissmaxerpissmaximizerpisscollector8000vor 7 Monaten

Wow that's really cool

Profilbild von honeybbqchicken
honeybbqchickenvor 7 Monaten

Is this analogous to betweenness centrality? I've been trying to understand the concept behind it.

Profilbild von CSS by T. Afif
CSS by T. Afifvor 7 Monaten

betweenness centrality uses the "shortest path" in its concept, it's not really analogy here.

Profilbild von Niko Alifero
Niko Aliferovor 7 Monaten

Why it won't showing the closest path when only one node in between? Did you made it to need to visit 2 nodes in between?

Profilbild von CSS by T. Afif
CSS by T. Afifvor 7 Monaten

There is no "one node in between" in that graph. Between S and E you have at least two nodes so any path needs to include at least two nodes and since we want the shortest path you won't find more than 2.

Profilbild von Niko Alifero
Niko Aliferovor 7 Monaten

With "one node in between" i mean when the shortest path only need one node. Anyway, your second sentence answer my question. Thanks

Profilbild von 64s
64svor 7 Monaten

okay cool - brute force but very neat

Profilbild von duar
duarvor 7 Monaten

God damn u... what a beautyy

Profilbild von apiep
apiepvor 7 Monaten

wait, with what...? css??? 😮

Profilbild von Dev Sharma -e/acc
Dev Sharma -e/accvor 7 Monaten

Perfect 🤩

Profilbild von Broda Noel
Broda Noelvor 7 Monaten

With CS… WHAT?!

Profilbild von I
Ivor 7 Monaten

Pec

Profilbild von Possible Pilot Deviation
Possible Pilot Deviationvor 7 Monaten

It's cool but in reality that would be mandated with bunch of airspace restrictions and other caveats that flight managers need to battle every day. But a really nice concept! It has a great potential for a good flight dispatch management program/app.

Profilbild von ANDRÉ ALFIERI
ANDRÉ ALFIERIvor 7 Monaten

There are some errors, some lines are missing with other possibilities, such as S > A > B > E (this path is never possible), but in any case it's an incredible piece of work

Profilbild von CSS by T. Afif
CSS by T. Afifvor 7 Monaten

It's a graph; I define the lines and the nodes and I didn't define any line between B and E. There is no mistakes. All the lines I defined are the one you see.

Profilbild von santi 🔜 hell
santi 🔜 hellvor 7 Monaten

holy shit

Profilbild von kaiser.eth
kaiser.ethvor 7 Monaten

genius. i've always supported the idea that css is an exoteric branch.

Profilbild von Jasiarz
Jasiarzvor 7 Monaten

CSS is not blo...

Profilbild von wsquarepa
wsquarepavor 7 Monaten

damn, no js is wild

Profilbild von Madhusoodan
Madhusoodanvor 7 Monaten

This is cool! Can it with some config go for an infinite adjustment?

Profilbild von CSS by T. Afif
CSS by T. Afifvor 7 Monaten

In a near future maybe. I actually just built one example as a proof of concept.

Profilbild von IsoWeeb
IsoWeebvor 7 Monaten

Jesus Christ, CSS is not supposed to be a programming language. wtf are we doing.

Ähnliche Videos

25 algorithms every programmer should know: Let's start with my top favorite 10. If nothing else, you should read about these algorithms and have a good idea of how they work: 1. Linear search to find an element in a list 2. Binary search to find an element on a sorted list 3. Bubble sort to sort a list 4. Merge sort will also sort lists 5. Quicksort to sort the list and do it fast 6. Dijkstra to find the shortest path in a graph 7. Breadth-first Search (BFS) for trees or graphs 8. Depth-first search (DFS) for trees or graphs 9. Huffman for doing data compression 10. Anything related to dynamic programming Learning about algorithms is like getting tattoos: you never have enough. Here are another 5 algorithms that will help you go beyond the basics: 11. Kruskal for the finding minimum spanning tree 12. Floyd Warshall, shortest paths in a graph 13. Union Find to detect cycles in a graph 14. Bellman-Ford, shortest path in a graph 15. Lee for finding the shortest path in a maze If you are serious about this topic, I recommend learning about algorithms' space and time complexity. People usually refer to this topic as "Big O" notation. You should build a good intuition about the performance of different algorithms and learn how to evaluate them. Machine Learning will rule the next 50 years, so the next 10 algorithms you can't ignore are the following: 16. Linear Regression 17. Logistic Regression 18. Decision Trees 19. Bayes' theorem 20. k-Nearest Neighbors (kNN) 21. Every algorithm related to neural networks 22. K-means 23. Random forest 24. Gradient boosting algorithms 25. Any dimensionality reduction algorithm (PCA, for instance) There are many more mind-blowing algorithms! I haven't found a better way to understand how computers work from a first-principles point of view than reading about different algorithms. Take a look at the attached video.

Santiago

274,092 Aufrufe • vor 2 Jahren