Live data from Hacker News

Ask HN: I'm trying to represent an entire building as a graph

news.ycombinator.com

21–30 of 30 posts

Re: Ask HN: I'm trying to represent an entire building as a graph

#21

Have you looked at just using IFC? It’s the canonical “building as a graph” BIM format. Whether the in memory IFC allows querying I suppose is up to the implementation, I have only used xbim https://github.com/xBimTeam

There is also IfcOWL, the RDF (semantic web / linked data) representation of IFC. It'll allow you to use standard tooling (e.g. SPARQL and storage engines). https://technical.buildingsmart.org/standards/ifc/ifc-format...

Re: Ask HN: I'm trying to represent an entire building as a graph

#22
Postgres works well. Neo4j. Persistence is pretty well solved.

So is the in-memory representation! Have you thought about using lazy structures? The graph can be conceptually infinite in size but your program only loads the pieces being used as they are needed and offloads old ones that are not.

Re: Ask HN: I'm trying to represent an entire building as a graph

#23
This reminded me of drafting electric diagrams in plans and elevations. And of course the notions of a 'plan' and and 'elevation' are also front and center.

Why were not graphs embraced by other domains? Plan and elevations by definition are constrained view points. (Hint: for the same reason the highly available and highly consistent flavors of graph databases require paid licenses :)

Graphs make for difficult decomposable 'unit' assemblies. Plans and elevations are 'standard units'. (Again: it may help to think of as plans and elevations as tables and reverse indexes, respectively.)

Note requirements such as e.g. "show directions from one entity to another" are also present for documenting the electrical systems, or HVAC, in a building.

A modular system for representing graphs of arbitrary scale is the minimal and trivial 'one node per modular unit'. The alternative is throwing huge amounts of processing power to allow arbitrary views into a graph at any scale.

IoT, as an 'integrated component' of building systems, will find a very happy place on plans and elevations.

Re: Ask HN: I'm trying to represent an entire building as a graph

#24
I would recommend storing your data using Tree Notation in a Tree Language. That way your data is as simple as possible. You could then compile it to whatever format is needed by your downstream tools. Here's a quick start:

http://treenotation.org/sandbox/build/#grammar%0A%20nodeType...

Re: Ask HN: I'm trying to represent an entire building as a graph

#26

graphviz

Graphviz is fine, specially for small graphs, but probably not what is required here. Plain pdf could be less painful if your graph program choose automatically reorder the data as it wants to optimize shorter paths (mixing nodes in second and fifth floor and then drawing first floor above the others for example is not what you could want).

It depends on what is really needed there. If is interactive or not and how complex. To draw a very complex building, something that will not place nodes and move lines around by itself (Autocad, etc) could be easily the weapon of choice here.

Re: Ask HN: I'm trying to represent an entire building as a graph

#28
post #26

graphviz

Graphviz is fine, specially for small graphs, but probably not what is required here. Plain pdf could be less painful if your graph program choose automatically reorder the data as it wants to optimize shorter paths (mixing nodes in second and fifth floor and then drawing first floor above the others for example is not what you could want). It depends on what is really needed there. If is interactive or not and how c…

Graphviz is a family of tools and a file format.

Being text based it is easily manipulable and readily scalable to many nodes. It also supports subgraphs.

I am surprised at being downvoted when suggesting what is quantifiably the most mature tool in the space.

PDF is a presentation format, and has nothing to do with graphs in the sense of data structures. The fact that the original question references photoshop shows that the person asking is not approaching the problem from a formal standpoint. This is asking for trouble.

Frankly, I am not sure a graph is the right data structure for this problem. It is more likely that a general purpose database would fulfil current and future requirements more effectively. Graphs could be generated from that trivially as representations.

Re: Ask HN: I'm trying to represent an entire building as a graph

#29
post #26

Earlier quoted context omitted.

Graphviz is fine, specially for small graphs, but probably not what is required here. Plain pdf could be less painful if your graph program choose automatically reorder the data as it wants to optimize shorter paths (mixing nodes in second and fifth floor and then drawing first floor above the others for example is not what you could want). It depends on what is really needed there. If is interactive or not and how c…

Graphviz is a family of tools and a file format. Being text based it is easily manipulable and readily scalable to many nodes. It also supports subgraphs. I am surprised at being downvoted when suggesting what is quantifiably the most mature tool in the space. PDF is a presentation format, and has nothing to do with graphs in the sense of data structures. The fact that the original question references photoshop shows…

I use graphviz often and I'm very happy with it. I'm aware of the cluster tool. Still sometimes I miss some things that graphviz does not have currently (and lisp, python or R could provide). If you need to represent a node in form of a computer, a switch or a room; graphviz is limited in that sense.

I agree in the database focus

Re: Ask HN: I'm trying to represent an entire building as a graph

#30
post #16

As you talked about BIM, I guess you are already aware of IFC. The real question is that your use case isn't very clear to me. What are you trying to achieve? Visualize a graph?

Visualization is a small part, yes. I'd like to control the building. An employee can enter a room and the system would do stuff. I can say that "it's kinda dark here" and the system would either open the blinds or switch on the light. Depending on a lot of parameters. The thing is, the BIM doesn't have the interior elements such as desks and printers, just the layout of the floors. That's why my current hack is to have a color coded floor plan which generates everything. The graph is always changing throughout the day, and there are a lot of ML algorithms running in the background, including graph classification. That's why I'm trying to represent everything as a graph.
Post reply on HN