# How to set a default value for the edge attribute 'weight'

**URL:** https://forum.graphviz.org/t/how-to-set-a-default-value-for-the-edge-attribute-weight/1132
**Category:** Help
**Created:** [April 21, 2022, 9:37am UTC](https://forum.graphviz.org/t/how-to-set-a-default-value-for-the-edge-attribute-weight/1132 "2022-04-21T09:37:04Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)
#### Post date: [April 21, 2022, 5:24pm UTC](https://forum.graphviz.org/t/how-to-set-a-default-value-for-the-edge-attribute-weight/1132/4 "2022-04-21T17:24:12Z")

</div>

Hmmm, the input you provide does not have `weight=9` applied to every edge, only about half.  
For example `"Log that line from var":e -> "For each line in var":e ` does not have a weight attribute.  
I created two variants of your graph - one with a `weight=9` global default and one with `weight=9` applied to _each_ edge. They produced (seemingly) identical results.  
The Graphviz syntax & semantics are a bit “eclectic” (see [Comma separated list of node IDs](https://forum.graphviz.org/t/comma-separated-list-of-node-ids/1085)), could this be causing confusion?

p.s. If you are trying to vertically align your nodes, you might look at **group** ([group | Graphviz](https://graphviz.org/docs/attrs/group/)), instead of **weight**

---

_[View the full topic](https://forum.graphviz.org/t/how-to-set-a-default-value-for-the-edge-attribute-weight/1132)._
