正在加载视频...

视频加载失败

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 次观看 • 7 个月前 •via X (Twitter)

42 条评论

Samiullah Khan 的头像
Samiullah Khan7 个月前

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

CSS by T. Afif 的头像
CSS by T. Afif7 个月前

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 😉

._. 的头像
._.7 个月前

pffffff… are youn human? 🧐

CSS by T. Afif 的头像
CSS by T. Afif7 个月前

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

._. 的头像
._.7 个月前

😆😆😆

CSS by T. Afif 的头像
CSS by T. Afif7 个月前

In case you want more CSS fun👇

Marchen 的头像
Marchen7 个月前

pure css doing graph theory. wild

David K 🎹 的头像
David K 🎹7 个月前

This is insanely cool

SolusOps 的头像
SolusOps7 个月前

is CSS Turing complete now?

Amphlux.ye 的头像
Amphlux.ye7 个月前

I submit 1571 as my top score

Kris des Chacals ∞ 的头像
Kris des Chacals ∞7 个月前

Next step: solve the travelling salesman problem with CSS 😄

Andy 的头像
Andy7 个月前

You are stacked and overflowing with talent.

Nakumbo 的头像
Nakumbo7 个月前

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

IGuano 的头像
IGuano7 个月前

is this just running dijkstras

rifusaki (woke izutsumi) 的头像
rifusaki (woke izutsumi)7 个月前

data analysis idea @ohsweetnothin

SuperKreator 的头像
SuperKreator7 个月前

@DaegoDaeki espabila

huehue 的头像
huehue7 个月前

Are you real ?

Starálfur 的头像
Starálfur7 个月前

CSS gone wild.

D7460N 的头像
D7460N7 个月前

This is amazing dude. Great job.

Josh 的头像
Josh7 个月前

@samwhoo Very very cool!

ultimatepissmaxerpissmaximizerpisscollector8000 的头像
ultimatepissmaxerpissmaximizerpisscollector80007 个月前

Wow that's really cool

honeybbqchicken 的头像
honeybbqchicken7 个月前

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

CSS by T. Afif 的头像
CSS by T. Afif7 个月前

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

Niko Alifero 的头像
Niko Alifero7 个月前

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?

CSS by T. Afif 的头像
CSS by T. Afif7 个月前

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.

Niko Alifero 的头像
Niko Alifero7 个月前

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

64s 的头像
64s7 个月前

okay cool - brute force but very neat

duar 的头像
duar7 个月前

God damn u... what a beautyy

apiep 的头像
apiep7 个月前

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

Dev Sharma -e/acc 的头像
Dev Sharma -e/acc7 个月前

Perfect 🤩

Broda Noel 的头像
Broda Noel7 个月前

With CS… WHAT?!

I 的头像
I7 个月前

Pec

Possible Pilot Deviation 的头像
Possible Pilot Deviation7 个月前

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.

ANDRÉ ALFIERI 的头像
ANDRÉ ALFIERI7 个月前

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

CSS by T. Afif 的头像
CSS by T. Afif7 个月前

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.

santi 🔜 hell 的头像
santi 🔜 hell7 个月前

holy shit

kaiser.eth 的头像
kaiser.eth7 个月前

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

Jasiarz 的头像
Jasiarz7 个月前

CSS is not blo...

wsquarepa 的头像
wsquarepa7 个月前

damn, no js is wild

Madhusoodan 的头像
Madhusoodan7 个月前

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

CSS by T. Afif 的头像
CSS by T. Afif7 个月前

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

IsoWeeb 的头像
IsoWeeb7 个月前

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

相关视频

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 次观看 • 2 年前